I am trying to print json result from struct I created as following:
type Machine struct { m_ip string m_type string m_serial string } and print out
m:= &Machine{ m_ip:"test", m_type:"test", m_serial:"test" } m_json:= json.Marshal(m) fmt.Println(m_json) However, result returned just {}
Secondly,I tried to changed the first letter of words to Uppercase as follow:
type Machine struct{ MachIp string MachType string MachSerial string } and it works! Why doesn't the word with lowercase character at the front work, anyway?