comparison pkg/auth/encode.go @ 5712:6270951dda28 revive-cleanup

/interface{}/any/
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 20 Feb 2024 22:37:51 +0100
parents 91f4b3f56ce2
children
comparison
equal deleted inserted replaced
5711:2dd155cc95ec 5712:6270951dda28
36 return n, r.Err 36 return n, r.Err
37 } 37 }
38 38
39 // ReadBin reads big endian encodes binary data into x. 39 // ReadBin reads big endian encodes binary data into x.
40 // If an error was encountered before no data is read. 40 // If an error was encountered before no data is read.
41 func (r *BinReader) ReadBin(x interface{}) { 41 func (r *BinReader) ReadBin(x any) {
42 if r.Err == nil { 42 if r.Err == nil {
43 r.Err = binary.Read(r.Reader, binary.BigEndian, x) 43 r.Err = binary.Read(r.Reader, binary.BigEndian, x)
44 } 44 }
45 } 45 }
46 46
81 return n, w.Err 81 return n, w.Err
82 } 82 }
83 83
84 // WriteBin writes x big endian encoded to the underlying io.Writer. 84 // WriteBin writes x big endian encoded to the underlying io.Writer.
85 // If an error was encountered before no data is written. 85 // If an error was encountered before no data is written.
86 func (w *BinWriter) WriteBin(x interface{}) { 86 func (w *BinWriter) WriteBin(x any) {
87 if w.Err == nil { 87 if w.Err == nil {
88 w.Err = binary.Write(w.Writer, binary.BigEndian, x) 88 w.Err = binary.Write(w.Writer, binary.BigEndian, x)
89 } 89 }
90 } 90 }
91 91