What is the meaning of the usage of. ([] byte) in golang

b, ok: = val. ([] byte)

if it"s a conversion type, shouldn"t it be [] byte (val)? it"s similar to string (val)

.
Sep.02,2021

this is not a conversion type. The so-called type assertion (type assertion), simply looks at whether the type of val is [] byte


.

some val cannot directly use [] byte (val) or similar to string (val).
first of all, if the val type is uncertain, you will not be able to use a compiler similar to string (val),.
if you already know your val type, you don't have to execute b, ok: = val. ([] byte), do you?

then b, ok: = val. ([] byte), if ok is true, it means success, and b can be used.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37245-2adb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37245-2adb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?