Skip to content

Commit

Permalink
remove unused marshal function
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Nov 21, 2023
1 parent 2900d99 commit de3cc20
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions hscontrol/mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,25 +405,6 @@ func (m *Mapper) marshalMapResponse(
return data, nil
}

// MarshalResponse takes an Tailscale Response, marhsal it to JSON.
// If isNoise is set, then the JSON body will be returned
// If !isNoise and privateKey2019 is set, the JSON body will be sealed in a Nacl box.
func MarshalResponse(
resp interface{},
) ([]byte, error) {
jsonBody, err := json.Marshal(resp)
if err != nil {
log.Error().
Caller().
Err(err).
Msg("Cannot marshal response")

return nil, err
}

return jsonBody, nil
}

func zstdEncode(in []byte) []byte {
encoder, ok := zstdEncoderPool.Get().(*zstd.Encoder)
if !ok {
Expand Down

0 comments on commit de3cc20

Please sign in to comment.