Skip to content

Commit c1cd252

Browse files
committed
upgrade Go to v1.24, trunk upgrade and golangci upgrade to v2
1 parent 4570b74 commit c1cd252

22 files changed

Lines changed: 56 additions & 51 deletions

File tree

.trunk/configs/.golangci.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
2+
"formatters": {
3+
"exclusions": {
4+
"generated": "lax",
5+
"paths": ["third_party$", "builtin$", "examples$"]
6+
}
7+
},
8+
"linters": {
9+
"exclusions": {
10+
"generated": "lax",
11+
"paths": ["third_party$", "builtin$", "examples$"],
12+
"presets": ["comments", "common-false-positives", "legacy", "std-error-handling"]
13+
}
14+
},
215
"run": {
316
"build-tags": ["integration"]
4-
}
17+
},
18+
"version": "2"
519
}

.trunk/trunk.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
33
version: 0.1
44
cli:
5-
version: 1.22.11
5+
version: 1.22.12
66

77
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
88
plugins:
99
sources:
1010
- id: trunk
11-
ref: v1.6.7
11+
ref: v1.6.8
1212
uri: https://github.com/trunk-io/plugins
1313

1414
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1515
runtimes:
1616
enabled:
17-
- go@1.23.8
17+
- go@1.24.2
1818
1919
2020

@@ -26,23 +26,23 @@ lint:
2626
- contrib/**
2727
- protos/pb/pb.pb.go
2828
enabled:
29-
29+
30+
3031
31-
32+
3233
3334
- git-diff-check
3435
35-
3636
3737
38-
38+
3939
4040
41-
- renovate@39.222.4
41+
- renovate@39.254.3
4242
4343
4444
45-
45+
4646
4747
actions:
4848
enabled:

dgraph/cmd/live/batch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func handleError(err error, isRetry bool) {
116116
" Will retry after %s.\n", err, dur.Round(time.Second))
117117
time.Sleep(dur)
118118
case strings.Contains(s.Message(), "x509"):
119-
x.Fatalf(s.Message())
119+
x.Fatalf("%v", s.Message())
120120
case s.Code() == codes.Aborted:
121121
if !isRetry && opt.verbose {
122122
fmt.Printf("Transaction aborted. Will retry in background.\n")
@@ -335,7 +335,7 @@ func (l *loader) conflictKeysForNQuad(nq *api.NQuad) ([]uint64, error) {
335335
}
336336

337337
if len(errs) > 0 {
338-
return keys, fmt.Errorf(strings.Join(errs, "\n"))
338+
return keys, fmt.Errorf("%v", strings.Join(errs, "\n"))
339339
}
340340
return keys, nil
341341
}

dgraph/cmd/live/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ func run() error {
829829
for _, file := range filesList {
830830
file = strings.Trim(file, " \t")
831831
go func(file string) {
832-
errCh <- errors.Wrapf(l.processFile(ctx, fs, file, opt.key), file)
832+
errCh <- errors.Wrap(l.processFile(ctx, fs, file, opt.key), file)
833833
}(file)
834834
}
835835

dql/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ func substituteVariables(gq *GraphQuery, vmap varMap) error {
507507
}
508508
depth, err := strconv.ParseUint(val.Value, 0, 64)
509509
if err != nil {
510-
return errors.Wrapf(err, varName+" should be type of integer")
510+
return errors.Wrapf(err, "%v should be type of integer", varName)
511511
}
512512
gq.RecurseArgs.Depth = depth
513513
}
@@ -521,7 +521,7 @@ func substituteVariables(gq *GraphQuery, vmap varMap) error {
521521
}
522522
allowLoop, err := strconv.ParseBool(val.Value)
523523
if err != nil {
524-
return errors.Wrapf(err, varName+"should be type of boolean")
524+
return errors.Wrapf(err, "%v should be type of boolean", varName)
525525
}
526526
gq.RecurseArgs.AllowLoop = allowLoop
527527
}

edgraph/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ func (s *Server) doMutate(ctx context.Context, qc *queryContext, resp *api.Respo
643643
trace.WithAttributes(attribute.String("err", err.Error())))
644644

645645
if err == dgo.ErrAborted {
646-
err = status.Errorf(codes.Aborted, err.Error())
646+
err = status.Error(codes.Aborted, err.Error())
647647
resp.Txn.Aborted = true
648648
}
649649

@@ -1842,7 +1842,7 @@ func (s *Server) CommitOrAbort(ctx context.Context, tc *api.TxnContext) (*api.Tx
18421842
return tctx, nil
18431843
}
18441844

1845-
return tctx, status.Errorf(codes.Aborted, err.Error())
1845+
return tctx, status.Error(codes.Aborted, err.Error())
18461846
}
18471847
tctx.StartTs = tc.StartTs
18481848
tctx.CommitTs = commitTs

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hypermodeinc/dgraph/v25
22

3-
go 1.23.8
3+
go 1.24.2
44

55
require (
66
contrib.go.opencensus.io/exporter/prometheus v0.4.2

graphql/e2e/custom_logic/cmd/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hypermodeinc/dgraph/graphql/e2e/custom_logic/cmd
22

3-
go 1.23.6
3+
go 1.24.2
44

55
require (
66
github.com/graph-gophers/graphql-go v1.6.0

graphql/resolve/mutation_rewriter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ func rewriteObject(
14421442
if queryAuthSelector(typ) == nil {
14431443
retErrors = append(retErrors, existenceError)
14441444
} else {
1445-
retErrors = append(retErrors, x.GqlErrorf("GraphQL debug: "+existenceError.Error()))
1445+
retErrors = append(retErrors, x.GqlErrorf("GraphQL debug: %v", existenceError.Error()))
14461446
}
14471447

14481448
return nil, "", retErrors
@@ -1491,7 +1491,7 @@ func rewriteObject(
14911491
if queryAuthSelector(typ) == nil {
14921492
retErrors = append(retErrors, existenceError)
14931493
} else {
1494-
retErrors = append(retErrors, x.GqlErrorf("GraphQL debug: "+existenceError.Error()))
1494+
retErrors = append(retErrors, x.GqlErrorf("GraphQL debug: %v", existenceError.Error()))
14951495
}
14961496
return nil, "", retErrors
14971497
}

graphql/resolve/resolver_error_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func complete(t *testing.T, gqlSchema schema.Schema, gqlQuery, dgResponse string
145145
err = schema.Unmarshal([]byte(dgResponse), &res)
146146
if err != nil {
147147
// TODO(abhimanyu): check if should port the test which requires this to e2e
148-
resp.Errors = x.GqlErrorList{x.GqlErrorf(err.Error()).WithLocations(op.Queries()[0].Location())}
148+
resp.Errors = x.GqlErrorList{x.GqlErrorf("%v", err.Error()).WithLocations(op.Queries()[0].Location())}
149149
}
150150

151151
// TODO(abhimanyu): completion can really be checked only for a single query,

0 commit comments

Comments
 (0)