all: replace empty slice literal with var (#8990)
refactor: replace empty slice literal with `var` An empty slice can be represented by `nil` or an empty slice literal. They are functionally equivalent — their `len` and `cap` are both zero — but the `nil` slice is the preferred style. For more information about empty slices, see [Declaring Empty Slices](https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices). Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
parent
f23c41221b
commit
21c074cc2c
@@ -32,7 +32,8 @@ func (t emptyDirTracker) addFile(path string) {
|
||||
}
|
||||
|
||||
func (t emptyDirTracker) emptyDirs() []string {
|
||||
empty := []string{}
|
||||
var empty []string
|
||||
|
||||
for dir := range t {
|
||||
empty = append(empty, dir)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@ func (v external) Archive(filePath string) error {
|
||||
cmd := exec.Command(words[0], words[1:]...)
|
||||
env := os.Environ()
|
||||
// filter STGUIAUTH and STGUIAPIKEY from environment variables
|
||||
filteredEnv := []string{}
|
||||
var filteredEnv []string
|
||||
|
||||
for _, x := range env {
|
||||
if !strings.HasPrefix(x, "STGUIAUTH=") && !strings.HasPrefix(x, "STGUIAPIKEY=") {
|
||||
filteredEnv = append(filteredEnv, x)
|
||||
|
||||
Reference in New Issue
Block a user