Skip to content

Commit

Permalink
Dont use method pointer for MarshalJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Mar 26, 2024
1 parent ebf809f commit 3d6b8e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions steamid/steamid.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (t *SteamID) Steam3() SID3 {
// return t.AccountType == AccountTypeChat && (int(t.Instance)&Lobby) || (int(t.Instance)&MMSLobby))
// }

func (t *SteamID) MarshalJSON() ([]byte, error) {
func (t SteamID) MarshalJSON() ([]byte, error) {
return []byte("\"" + t.String() + "\""), nil
}

Expand Down Expand Up @@ -347,7 +347,7 @@ func (t *SteamID) UnmarshalJSON(data []byte) error {
}

// MarshalText implements encoding.TextMarshaler which is used by the yaml package for marshalling.
func (t *SteamID) MarshalText() ([]byte, error) {
func (t SteamID) MarshalText() ([]byte, error) {
return []byte(t.String()), nil
}

Expand Down

0 comments on commit 3d6b8e6

Please sign in to comment.