Skip to content

Commit

Permalink
FIxed the linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
vkrasnici committed Nov 22, 2024
1 parent 58a71c9 commit c95d470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/LICENSE_OF_DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ following works:
- collectd.org [ISC License](https://github.com/collectd/go-collectd/blob/master/LICENSE)
- dario.cat/mergo [BSD 3-Clause "New" or "Revised" License](https://github.com/imdario/mergo/blob/master/LICENSE)
- filippo.io/edwards25519 [BSD 3-Clause "New" or "Revised" License](https://github.com/FiloSottile/edwards25519/blob/main/LICENSE)
- github.com/99designs/go-keychain [MIT License](https://github.com/99designs/go-keychain/blob/master/LICENSE)
- github.com/99designs/keyring [MIT License](https://github.com/99designs/keyring/blob/master/LICENSE)
- github.com/Azure/azure-amqp-common-go [MIT License](https://github.com/Azure/azure-amqp-common-go/blob/master/LICENSE)
- github.com/Azure/azure-event-hubs-go [MIT License](https://github.com/Azure/azure-event-hubs-go/blob/master/LICENSE)
Expand Down Expand Up @@ -139,6 +140,7 @@ following works:
- github.com/gabriel-vasile/mimetype [MIT License](https://github.com/gabriel-vasile/mimetype/blob/master/LICENSE)
- github.com/go-asn1-ber/asn1-ber [MIT License](https://github.com/go-asn1-ber/asn1-ber/blob/v1.3/LICENSE)
- github.com/go-chi/chi [MIT License](https://github.com/go-chi/chi/blob/master/LICENSE)
- github.com/go-darwin/apfs [BSD 3-Clause "New" or "Revised" License] (https://github.com/go-darwin/apfs/blob/main/LICENSE)
- github.com/go-git/go-billy [Apache License 2.0](https://github.com/go-git/go-billy/blob/master/LICENSE)
- github.com/go-ldap/ldap [MIT License](https://github.com/go-ldap/ldap/blob/v3.4.1/LICENSE)
- github.com/go-logfmt/logfmt [MIT License](https://github.com/go-logfmt/logfmt/blob/master/LICENSE)
Expand Down
5 changes: 2 additions & 3 deletions plugins/processors/converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,17 @@ func base64ToFloat32(encoded string) (float32, error) {
}

// Convert the bytes to a string representation as per IEEE 754 of the bits
bits_str_representation := fmt.Sprintf("%08b%08b%08b%08b", decodedBytes[0], decodedBytes[1], decodedBytes[2], decodedBytes[3])
bitsStrRepresentation := fmt.Sprintf("%08b%08b%08b%08b", decodedBytes[0], decodedBytes[1], decodedBytes[2], decodedBytes[3])

// Convert the bits to a uint32
bits, err := strconv.ParseUint(bits_str_representation, 2, 32)
bits, err := strconv.ParseUint(bitsStrRepresentation, 2, 32)

if err != nil {
return 0, err
}

// Convert the uint32 (bits) to a float32 based on IEEE 754 binary representation
return math.Float32frombits(uint32(bits)), nil

}

func init() {
Expand Down

0 comments on commit c95d470

Please sign in to comment.