Skip to content

Commit

Permalink
build: use exp slog to support go 1.20
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <shoothzj@gmail.com>
  • Loading branch information
shoothzj committed Oct 16, 2024
1 parent 5ea052a commit abd420d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Requirements

- Go 1.21+
- Go 1.20+

## 🚀 Install

Expand Down
3 changes: 2 additions & 1 deletion examples/client/client.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package main

import (
"log/slog"
"os"
"os/signal"
"syscall"

"golang.org/x/exp/slog"

"github.com/libgox/addr"
"github.com/protocol-laboratory/opcua-go/opcua"
"github.com/protocol-laboratory/opcua-go/opcua/ua"
Expand Down
3 changes: 2 additions & 1 deletion examples/server/server.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
"log/slog"
"os"
"os/signal"
"syscall"
"time"

"golang.org/x/exp/slog"

"github.com/protocol-laboratory/opcua-go/opcua"
)

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/protocol-laboratory/opcua-go

go 1.21
go 1.20

require (
github.com/libgox/addr v0.2.0
github.com/libgox/buffer v0.0.0-20241015042438-2a8f016fc865
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
3 changes: 2 additions & 1 deletion opcua/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"crypto/tls"
"encoding/binary"
"fmt"
"log/slog"
"net"
"sync"

"golang.org/x/exp/slog"

"github.com/libgox/addr"
"github.com/libgox/buffer"

Expand Down
3 changes: 2 additions & 1 deletion opcua/secure_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package opcua

import (
"errors"
"log/slog"
"sync/atomic"

"golang.org/x/exp/slog"

"github.com/protocol-laboratory/opcua-go/opcua/enc"
"github.com/protocol-laboratory/opcua-go/opcua/uamsg"
"github.com/protocol-laboratory/opcua-go/opcua/util"
Expand Down
3 changes: 2 additions & 1 deletion opcua/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package opcua

import (
"fmt"
"log/slog"
"net"
"sync"
"time"

"golang.org/x/exp/slog"

"github.com/libgox/buffer"
)

Expand Down
3 changes: 2 additions & 1 deletion opcua/server_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package opcua

import (
"log/slog"
"testing"

"golang.org/x/exp/slog"

"github.com/libgox/addr"
"github.com/protocol-laboratory/opcua-go/opcua/ua"
"github.com/stretchr/testify/assert"
Expand Down

0 comments on commit abd420d

Please sign in to comment.