I am trying to pack some data to struct like python but not sure how approach it. it has multiple different type of data.
>>> z = [1,2 , b"hello"]
>>> f = "<i b 5s"
>>> p = struct.pack(f,*z)
>>> p
b'\x01\x00\x00\x00\x02hello'
>>>
I can do like this for python. I want to do something similar in go
here in format f , <i is little E int , b is signed char , 5s is []char with 5 size