Skip to content

Commit

Permalink
Update deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Mar 12, 2022
1 parent b8a2379 commit 6cd8623
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"golang.org/x/crypto/acme/autocert"
"resenje.org/email"
"resenje.org/recovery"
Expand Down Expand Up @@ -83,8 +84,8 @@ func New(o Options) (s *Server, err error) {

// register standard metrics
s.metricsRegistry.MustRegister(
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
prometheus.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
collectors.NewGoCollector(),
)

var certificates []tls.Certificate
Expand Down
7 changes: 4 additions & 3 deletions servers/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"resenje.org/web/servers/grpc/internal/hello"
)

Expand Down Expand Up @@ -41,7 +42,7 @@ func TestServer(t *testing.T) {
}
}()

conn, err := grpc.Dial(addr, grpc.WithInsecure())
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -82,7 +83,7 @@ func TestServerShutdown(t *testing.T) {
}
}()

conn, err := grpc.Dial(addr, grpc.WithInsecure())
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -132,7 +133,7 @@ func TestServerClose(t *testing.T) {
}
}()

conn, err := grpc.Dial(addr, grpc.WithInsecure())
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 6cd8623

Please sign in to comment.