Struct method is setting field but they are not being "saved"? : <p>I know the title is confusing, and it is for me as well, as it says I have packets that decode binary data from byte buffers, each data value is set to a specific field of a struct. First I make a new struct of that type and call the "Decode" method: </p>

<pre><code>text := packets.NewTextPacket()
text.Buffer = bytes
text.DecodeHeader()
text.Decode()
</code></pre>

<p>The problem is that I specifically call the method called "Decode", here you can see what it does:</p>

<pre><code>func (pk TextPacket) Decode() {
    pk.TextType = pk.GetByte()
    pk.Translation = pk.GetBool()

    switch pk.TextType {
    case Raw, Tip, System:
        pk.Message = pk.GetString()
        break
    case Chat, Whisper, Announcement:
        pk.Source = pk.GetString()
        pk.SourceThirdParty = pk.GetString()
        pk.SourcePlatform = pk.GetVarInt()
        pk.Message = pk.GetString()
        break
    case Translation, Popup, JukeboxPopup:
        pk.Message = pk.GetString()
        c := pk.GetUnsignedVarInt()
        for i := uint32(0); i &lt; c; i++ {
            pk.Params = append(pk.Params, pk.GetString())
        }
        break
    }

    pk.Xuid = pk.GetString()
    pk.PlatformChatId = pk.GetString()
}
</code></pre>

<p>When I print <code>pk.Message</code> inside <code>func (pk TextPacket) Decode()</code> it shows the correct string, but printing it after <code>text.Decode()</code> as <code>text.Message</code>, it shows the default value that is set when the struct is first made, which is an empty string, same goes for all the other fields such as <code>text.TextType</code>, etc.</p>
