-
Notifications
You must be signed in to change notification settings - Fork 409
Open
Description
any suggestion i got error like this :

my repo based on this repo : https://github.com/bazel-contrib/rules_go/tree/master/examples/basic_gazelle
i just change the go to 1.24.5 and also rules go version and gazelle version to latest like this :
module(name = "basic_gazelle")
# This example depends on the Bazel modules rules_go and gazelle.
# Bazel modules are different than Go modules: Bazel modules are
# published on registry.bazel.build and have their own build files.
bazel_dep(name = "rules_go", version = "0.55.1")
bazel_dep(name = "gazelle", version = "0.44.0")
# Configure rules_go to download and build with a specific version of Go.
#
# use_extension here loads the go_sdk Bazel module extension.
# A module extension is a bit of code that tells Bazel how to fetch things
# that aren't normal modules.
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.24.5")
# Configure Gazelle to load the list of Go modules from go.mod using the
# go_deps module extension.
#
# go_deps fetches Go modules using 'go mod download'. It then generates
# build files for them using Gazelle.
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
# Import repos generated by the go_deps module extension into this module.
#
# A Bazel repo is a separate source tree, either provided by a Bazel module
# (bazel_dep) or a module extension. go_deps creates a repo for each Go module.
# We must declare the modules we use directory from this repository, but the
# list does not need to be maintained manually: you can run 'bazel mod tidy' to
# update it automatically.
#
# Bazel repo names allow a limited set of characters, so Go module
# paths need to be transformed. Domains like golang.org are reversed, and
# characters other than letters and numbers are replaced with underscores (_).
# So "golang.org/x/net" becomes "org_golang_x_net".
#
# You can refer to targets within these repos with a label like
# "@org_golang_x_net//html".
use_repo(
go_deps,
"com_github_stretchr_testify",
"org_golang_x_net",
)
# This file tells Bazel what to build.
#
# The part that loads the "gazelle" rule and declares the "gazelle" target
# are hand-written. Gazelle can be run with:
#
# bazel run //:gazelle
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
gazelle(name = "gazelle")
# Everything below here was generated with Gazelle. Try renaming printlinks.go,
# then run the command above. It should update the go_library target.
go_library(
name = "basic_gazelle_lib",
srcs = ["printlinks.go"],
importpath = "github.com/bazel-contrib/rules_go/examples/basic_gazelle",
visibility = ["//visibility:private"],
deps = [
"@org_golang_x_net//html",
"@org_golang_x_net//html/atom",
],
)
go_binary(
name = "basic_gazelle",
embed = [":basic_gazelle_lib"],
visibility = ["//visibility:public"],
)
go_test(
name = "basic_gazelle_test",
srcs = ["printlinks_test.go"],
embed = [":basic_gazelle_lib"],
deps = [
"@com_github_stretchr_testify//assert",
"@org_golang_x_net//html",
],
)
// Go uses this file to track module dependencies and to mark the root directory
// of a Go module. This file is maintained with Go tools outside of Bazel.
// For example, you can use 'bazel run @rules_go//go -- mod tidy' or
// 'go mod tidy' to add requirements for missing modules.
//
// Gazelle's go_deps module extension imports dependency declarations
// from this file.
module github.com/bazel-contrib/rules_go/examples/basic_gazelle
go 1.24.5
require (
github.com/stretchr/testify v1.10.0
golang.org/x/net v0.34.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Metadata
Metadata
Assignees
Labels
No labels