Question: redundant slice element in gazelle Import() function?
While studying the source code, I came across this line: https://github.com/bazelbuild/bazel-skylib/blob/872e9b06e18ae8ba2897cb65b9aaa172aa6279f3/gazelle/bzl/gazelle.go#L114
Later on, imports will be appended by as many as len(srcs) elements:
https://github.com/bazelbuild/bazel-skylib/blob/872e9b06e18ae8ba2897cb65b9aaa172aa6279f3/gazelle/bzl/gazelle.go#L116-L126
At the end, len(imports) and cap(imports) both become 2*len(srcs), which seems odd to me because at first it was only allocated for len(srcs) elements.
Does it make sense to change
imports := make([]resolve.ImportSpec, len(srcs))
to
imports := make([]resolve.ImportSpec, 0, len(srcs))?
Note that I am very new to golang, so chances are high that I could be wrong.