Skip to content

Commit

Permalink
Update (#2067)
Browse files Browse the repository at this point in the history
* fix(test): make vet

* ⏪️fix(ci): revert dependency version
go: downloading github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9
gcc: error: unrecognized command-line option ‘-mthreads’; did you mean ‘-pthread’?
Error: ../../../go/pkg/mod/golang.org/x/net@v0.23.0/http2/transport.go:1096:13: tc.NetConn undefined (type *tls.Conn has no field or method NetConn)
note: module requires Go 1.18
Error: Process completed with exit code 2.

* feat(update): go get -u ./..

* chore(style): same as #2066

* fix(ci): go version up
- google.golang.org/grpc/internal/channelz
note: module requires Go 1.19
- github.com/jackc/puddle/v2
note: module requires Go 1.19
  • Loading branch information
alex-dna-tech committed Apr 21, 2024
1 parent 4aeed4b commit 812b7b0
Show file tree
Hide file tree
Showing 18 changed files with 210 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18
go-version: 1.19
id: go

- name: Clone repo
Expand Down
7 changes: 4 additions & 3 deletions cmd/client/auth/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -61,7 +62,7 @@ func listAccounts(ctx *cli.Context) error {

func createAccount(ctx *cli.Context) error {
if ctx.Args().Len() == 0 {
return fmt.Errorf("Missing argument: ID")
return errors.New("Missing argument: ID")
}

env, err := util.GetEnv(ctx)
Expand Down Expand Up @@ -98,7 +99,7 @@ func createAccount(ctx *cli.Context) error {

func deleteAccount(ctx *cli.Context) error {
if ctx.Args().Len() == 0 {
return fmt.Errorf("Missing argument: ID")
return errors.New("Missing argument: ID")
}
cli := pb.NewAccountsService("auth", client.DefaultClient)

Expand All @@ -124,7 +125,7 @@ func deleteAccount(ctx *cli.Context) error {

func updateAccount(ctx *cli.Context) error {
if ctx.Args().Len() == 0 {
return fmt.Errorf("Missing argument: ID")
return errors.New("Missing argument: ID")
}

env, err := util.GetEnv(ctx)
Expand Down
13 changes: 7 additions & 6 deletions cmd/client/auth/rules.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cli

import (
"errors"
"fmt"
"os"
"sort"
Expand All @@ -12,7 +13,7 @@ import (
pb "micro.dev/v4/proto/auth"
"micro.dev/v4/service/client"
"micro.dev/v4/service/context"
"micro.dev/v4/service/errors"
mer "micro.dev/v4/service/errors"
"micro.dev/v4/util/namespace"
)

Expand Down Expand Up @@ -80,7 +81,7 @@ func createRule(ctx *cli.Context) error {
_, err = cli.Create(context.DefaultContext, &pb.CreateRequest{
Rule: rule, Options: &pb.Options{Namespace: ns},
}, client.WithAuthToken())
if verr := errors.FromError(err); verr != nil {
if verr := mer.FromError(err); verr != nil {
return fmt.Errorf("Error: %v", verr.Detail)
} else if err != nil {
return err
Expand All @@ -92,7 +93,7 @@ func createRule(ctx *cli.Context) error {

func deleteRule(ctx *cli.Context) error {
if ctx.Args().Len() != 1 {
return fmt.Errorf("Expected one argument: ID")
return errors.New("Expected one argument: ID")
}

env, err := util.GetEnv(ctx)
Expand All @@ -108,7 +109,7 @@ func deleteRule(ctx *cli.Context) error {
_, err = cli.Delete(context.DefaultContext, &pb.DeleteRequest{
Id: ctx.Args().First(), Options: &pb.Options{Namespace: ns},
}, client.WithAuthToken())
if verr := errors.FromError(err); err != nil {
if verr := mer.FromError(err); err != nil {
return fmt.Errorf("Error: %v", verr.Detail)
} else if err != nil {
return err
Expand All @@ -120,7 +121,7 @@ func deleteRule(ctx *cli.Context) error {

func constructRule(ctx *cli.Context) (*pb.Rule, error) {
if ctx.Args().Len() != 1 {
return nil, fmt.Errorf("Too many arguments, expected one argument: ID")
return nil, errors.New("Too many arguments, expected one argument: ID")
}

var access pb.Access
Expand All @@ -135,7 +136,7 @@ func constructRule(ctx *cli.Context) (*pb.Rule, error) {

resComps := strings.Split(ctx.String("resource"), ":")
if len(resComps) != 3 {
return nil, fmt.Errorf("Invalid resource, must be in the format type:name:endpoint")
return nil, errors.New("Invalid resource, must be in the format type:name:endpoint")
}

return &pb.Rule{
Expand Down
5 changes: 3 additions & 2 deletions cmd/client/auth/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"encoding/json"
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -29,10 +30,10 @@ func createToken(ctx *cli.Context) error {
expiry := ctx.Int("expiry")

if len(id) == 0 {
return fmt.Errorf("Missing account ID")
return errors.New("Missing account ID")
}
if len(secret) == 0 {
return fmt.Errorf("Missing account secret")
return errors.New("Missing account secret")
}

options := []auth.TokenOption{auth.WithTokenIssuer(ns)}
Expand Down
5 changes: 3 additions & 2 deletions cmd/client/config/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"encoding/json"
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -30,7 +31,7 @@ func setConfig(ctx *cli.Context) error {
pb := proto.NewConfigService("config", client.DefaultClient)

if len(key) == 0 || len(val) == 0 {
return fmt.Errorf("missing path or value")
return errors.New("missing path or value")
}

env, err := util.GetEnv(ctx)
Expand Down Expand Up @@ -114,7 +115,7 @@ func getConfig(ctx *cli.Context) error {
}

if v := rsp.Value.Data; len(v) == 0 || strings.TrimSpace(string(v)) == "null" {
return fmt.Errorf("not found")
return errors.New("not found")
}

if strings.HasPrefix(rsp.Value.Data, "\"") && strings.HasSuffix(rsp.Value.Data, "\"") {
Expand Down
3 changes: 2 additions & 1 deletion cmd/client/run/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package runtime

import (
"encoding/json"
"errors"
"fmt"
"net/http"
"os"
Expand Down Expand Up @@ -353,7 +354,7 @@ func runService(ctx *cli.Context) error {
}
if split[0] == "source" {
// reserved
return fmt.Errorf("invalid metadata string, 'source' is a reserved key")
return errors.New("invalid metadata string, 'source' is a reserved key")
}

srv.Metadata[split[0]] = split[1]
Expand Down
3 changes: 2 additions & 1 deletion cmd/client/util/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package util
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"os"
"sort"
Expand Down Expand Up @@ -262,7 +263,7 @@ func constructEndpoint(args []string) (string, error) {
case 3:
epComps = args[1:3]
default:
return "", fmt.Errorf("Incorrect number of arguments")
return "", errors.New("Incorrect number of arguments")
}

// transform the endpoint components, e.g ["helloworld", "call"] to the
Expand Down
77 changes: 41 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,71 @@ module micro.dev/v4
go 1.20

require (
github.com/bitly/go-simplejson v0.5.0
github.com/bitly/go-simplejson v0.5.1
github.com/davecgh/go-spew v1.1.1
github.com/dustin/go-humanize v1.0.0
github.com/evanphx/json-patch/v5 v5.5.0
github.com/fsnotify/fsnotify v1.4.9
github.com/golang-jwt/jwt v0.0.0-20210529014511-0f726ea0e725
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.7.3
github.com/gorilla/websocket v1.4.2
github.com/dustin/go-humanize v1.0.1
github.com/evanphx/json-patch/v5 v5.9.0
github.com/fsnotify/fsnotify v1.7.0
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.6.0
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.1
github.com/hpcloud/tail v1.0.0
github.com/kr/pretty v0.3.0
github.com/nightlyone/lockfile v1.0.0
github.com/onsi/gomega v1.10.0
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516
github.com/stretchr/objx v0.5.0
github.com/stretchr/testify v1.8.1
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
github.com/urfave/cli/v2 v2.3.0
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca
go.etcd.io/bbolt v1.3.5
golang.org/x/crypto v0.21.0
golang.org/x/net v0.23.0
google.golang.org/grpc v1.54.1
google.golang.org/protobuf v1.28.1
gorm.io/driver/postgres v1.4.5
gorm.io/driver/sqlite v1.4.3
gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e
github.com/stretchr/objx v0.5.2
github.com/stretchr/testify v1.9.0
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569
github.com/urfave/cli/v2 v2.27.1
github.com/xlab/treeprint v1.2.0
go.etcd.io/bbolt v1.3.9
golang.org/x/crypto v0.22.0
golang.org/x/net v0.24.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
gorm.io/driver/postgres v1.5.7
gorm.io/driver/sqlite v1.5.5
gorm.io/gorm v1.25.9
)

require (
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.13.0 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
github.com/jackc/pgx/v4 v4.17.2 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgtype v1.14.3 // indirect
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-sqlite3 v1.14.15 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.6.1 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
Loading

0 comments on commit 812b7b0

Please sign in to comment.