diff options
author | hchsiao <hchsiao@users.noreply.github.com> | 2022-08-17 00:00:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 12:00:42 -0400 |
commit | c1dfc324fbac0d5e4da32a93a3cafb2dc8908a09 (patch) | |
tree | c22fb680e71450177fa8e3e141ce127c3608a2a3 | |
parent | 872e9b06e18ae8ba2897cb65b9aaa172aa6279f3 (diff) | |
download | bazel-skylib-c1dfc324fbac0d5e4da32a93a3cafb2dc8908a09.tar.gz |
Fixing typo: allocate slice with the correct size (#383)
-rw-r--r-- | gazelle/bzl/gazelle.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gazelle/bzl/gazelle.go b/gazelle/bzl/gazelle.go index dccec27..433be6a 100644 --- a/gazelle/bzl/gazelle.go +++ b/gazelle/bzl/gazelle.go @@ -111,7 +111,7 @@ func (*bzlLibraryLang) Fix(c *config.Config, f *rule.File) {} // returned, including an empty slice, the rule will be indexed. func (b *bzlLibraryLang) Imports(c *config.Config, r *rule.Rule, f *rule.File) []resolve.ImportSpec { srcs := r.AttrStrings("srcs") - imports := make([]resolve.ImportSpec, len(srcs)) + imports := make([]resolve.ImportSpec, 0, len(srcs)) for _, src := range srcs { spec := resolve.ImportSpec{ |