Skip to content

Commit af14265

Browse files
committed
👷 Config nogo and fix detected errors
1 parent d89bc14 commit af14265

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
load("@gazelle//:def.bzl", "gazelle")
2-
load("@rules_go//go:def.bzl", "go_binary", "go_cross_binary", "go_library")
2+
load("@rules_go//go:def.bzl", "TOOLS_NOGO", "go_binary", "go_cross_binary", "go_library", "nogo")
33

44
gazelle(name = "gazelle")
55

6+
nogo(
7+
name = "yutu_nogo",
8+
visibility = ["//visibility:public"],
9+
deps = TOOLS_NOGO,
10+
)
11+
612
go_library(
713
name = "yutu_lib",
814
srcs = ["main.go"],

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ bazel_dep(name = "gazelle", version = "0.43.0")
55

66
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
77
go_sdk.from_file(go_mod = "//:go.mod")
8+
go_sdk.nogo(nogo = "//:yutu_nogo")
89

910
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
1011
go_deps.from_file(go_mod = "//:go.mod")

pkg/auth/auth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ func InitClient(
6363
tokenSource := config.TokenSource(ctx, authedToken)
6464
authedToken, err = tokenSource.Token()
6565
if err != nil && cacheable {
66-
client, authedToken := newClient(ctx, config)
66+
var client *http.Client
67+
client, authedToken = newClient(ctx, config)
6768
saveToken(cacheTokenFile, authedToken)
6869
return client
6970
} else if err != nil {

0 commit comments

Comments
 (0)