Skip to content

Commit

Permalink
Upgraded to go 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin committed Jan 21, 2024
1 parent 7c6471b commit 7c4a4f2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/bezineb5/ntrip-client

go 1.19
go 1.21

require (
github.com/chewxy/math32 v1.10.1
github.com/go-gnss/ntrip v0.0.13
github.com/go-gnss/ntrip v0.0.14
)

require (
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
golang.org/x/sys v0.16.0 // indirect
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ github.com/chewxy/math32 v1.10.1/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUw
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-gnss/ntrip v0.0.13 h1:ZG/WPOd8r3B5GgpwYTGsjLCuqU0Pvq0vkwJWzVs86YY=
github.com/go-gnss/ntrip v0.0.13/go.mod h1:TBB2ymCoYtH2RfE0Do+mtzmVuZB0gob5b8arEonOXys=
github.com/go-gnss/ntrip v0.0.14 h1:semhNZ4R5QCcyjJ83ip7UxG1g0zQUthozBcyJJYRZwI=
github.com/go-gnss/ntrip v0.0.14/go.mod h1:TBB2ymCoYtH2RfE0Do+mtzmVuZB0gob5b8arEonOXys=
github.com/gobuffalo/httptest v1.5.0 h1:kzrM6oEJccNN36cow9fLvgWfwUpUfwBBelsgA6Gghnk=
github.com/gobuffalo/httptest v1.5.0/go.mod h1:F541Rwcu9Ypo1NBAsYxrCV0J6ibAGGEvhM3653G+u5I=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand All @@ -18,8 +18,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand All @@ -28,8 +28,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
Expand Down
8 changes: 4 additions & 4 deletions input/ntrip_client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package input
import (
"bufio"
"fmt"
"io/ioutil"
"log"
"io"
"log/slog"
"net/http"
"sync"

Expand Down Expand Up @@ -44,7 +44,7 @@ func (c *ntripClient) SourceTable() (ntrip.Sourcetable, error) {
return ntrip.Sourcetable{}, fmt.Errorf("received non-200 response code: %d", resp.StatusCode)
}

data, err := ioutil.ReadAll(resp.Body)
data, err := io.ReadAll(resp.Body)
if err != nil {
return ntrip.Sourcetable{}, err
}
Expand Down Expand Up @@ -103,7 +103,7 @@ func (c *ntripMountPointClient) Stream() (<-chan []byte, error) {
default:
line, err := buf.ReadBytes('\n')
if err != nil {
log.Println("Error in reading mountpoint", err)
slog.Error("Error in reading mountpoint", slog.Any("error", err))
return
}

Expand Down
10 changes: 5 additions & 5 deletions mountpoint_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ntrip_client
import (
"errors"
"io"
"log"
"log/slog"
"sync"
"sync/atomic"

Expand Down Expand Up @@ -77,7 +77,7 @@ func (s *registrySelector) Stream() (<-chan []byte, error) {

if currentRtcm != nil {
if currentMountpoint, err = s.refRtcm.Stream(); err != nil {
log.Println("Error in streaming mountpoint", err)
slog.Error("Error in streaming mountpoint", slog.Any("error", err))
}
}

Expand All @@ -97,7 +97,7 @@ func (s *registrySelector) Stream() (<-chan []byte, error) {
if mp != nil {
currentMountpoint, err = mp.Stream()
if err != nil {
log.Println("Error in streaming mountpoint", err)
slog.Error("Error in streaming new mountpoint", slog.Any("error", err))
}
} else {
currentMountpoint = nil
Expand All @@ -115,7 +115,7 @@ func (s *registrySelector) Stream() (<-chan []byte, error) {
if currentRtcm != nil {
currentMountpoint, err = currentRtcm.Stream()
if err != nil {
log.Println("Error in streaming mountpoint", err)
slog.Error("Error in streaming current mountpoint", slog.Any("error", err))
}
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func (s *registrySelector) SetLocation(lat float32, lng float32) error {
}

// Update the mountpoint without breaking the stream
log.Printf("Selected mountpoint: %s at distance %f m", nearestMP, nearests[0].distanceInM)
slog.Info("Switching to new mountpoint", slog.String("mountpoint", nearestMP), slog.Float64("distance", float64(nearests[0].distanceInM)))
client := input.NewNtripV2MountPointClient(nearestMP)
s.refMountpoint = nearestMP

Expand Down

0 comments on commit 7c4a4f2

Please sign in to comment.