Closed madwizard closed 5 years ago
Adding TrimSuffix for trimming new line in this line: https://github.com/adrianmo/go-nmea/blob/9861e243767ddcbc01ec662adc18b97a35f2bbe7/sentence.go#L70
Fixed it for me:
checksumRaw = strings.TrimSuffix(strings.ToUpper(raw[sumSepIndex+1:]), "\n")
Does the string you're parsing have a tailing newline? You should be using a bufio.Scanner
.
Ok, thank you, I'll check it.
I am running your example code on GNRMC data received from my GNSS module. On nmea.Parse(sentence) I get:
Both checksums seem the same to me in the output above. The place I pasted your example code:
https://github.com/madwizard/zut_wifi_logger/blob/2aead364882076d5a836c105a30cb6760d14c266/gps.go#L42