Configure golangci-lint and fix warnings

This commit is contained in:
Jan Dittberner 2021-01-09 11:24:40 +01:00
parent ecd1846975
commit 2e467b3d2e
20 changed files with 915 additions and 559 deletions

View file

@ -7,6 +7,7 @@ const signerTimeFormat = "010203042006.05"
func Encode24BitLength(data []byte) []byte {
lengthBytes := make([]byte, 4)
binary.BigEndian.PutUint32(lengthBytes, uint32(len(data)))
return lengthBytes[1:]
}
@ -17,10 +18,12 @@ func Decode24BitLength(bytes []byte) int {
func CalculateXorCheckSum(byteBlocks [][]byte) byte {
var result byte = 0x0
for _, byteBlock := range byteBlocks {
for _, b := range byteBlock {
result ^= b
}
}
return result
}