File tree 1 file changed +9
-7
lines changed
src/cmd/go/internal/clean
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,15 @@ func runClean(cmd *base.Command, args []string) {
126
126
if cfg .BuildN || cfg .BuildX {
127
127
b .Showcmd ("" , "rm -r %s" , strings .Join (subdirs , " " ))
128
128
}
129
- printedErrors := false
130
- for _ , d := range subdirs {
131
- // Only print the first error - there may be many.
132
- // This also mimics what os.RemoveAll(dir) would do.
133
- if err := os .RemoveAll (d ); err != nil && ! printedErrors {
134
- printedErrors = true
135
- base .Errorf ("go clean -cache: %v" , err )
129
+ if ! cfg .BuildN {
130
+ printedErrors := false
131
+ for _ , d := range subdirs {
132
+ // Only print the first error - there may be many.
133
+ // This also mimics what os.RemoveAll(dir) would do.
134
+ if err := os .RemoveAll (d ); err != nil && ! printedErrors {
135
+ printedErrors = true
136
+ base .Errorf ("go clean -cache: %v" , err )
137
+ }
136
138
}
137
139
}
138
140
}
You can’t perform that action at this time.
0 commit comments