File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,14 +150,14 @@ func (v *filterValue) Type() string {
150150}
151151
152152func main () {
153- err := mainImplementation ()
153+ err := mainImplementation (os . Args [ 1 :] )
154154 if err != nil {
155155 fmt .Fprintf (os .Stderr , "error: %s\n " , err )
156156 os .Exit (1 )
157157 }
158158}
159159
160- func mainImplementation () error {
160+ func mainImplementation (args [] string ) error {
161161 var nameStyle sizes.NameStyle = sizes .NameStyleFull
162162 var cpuprofile string
163163 var jsonOutput bool
@@ -250,7 +250,7 @@ func mainImplementation() error {
250250
251251 flags .SortFlags = false
252252
253- err = flags .Parse (os . Args [ 1 :] )
253+ err = flags .Parse (args )
254254 if err != nil {
255255 if err == pflag .ErrHelp {
256256 return nil
@@ -280,9 +280,7 @@ func mainImplementation() error {
280280 return nil
281281 }
282282
283- args := flags .Args ()
284-
285- if len (args ) != 0 {
283+ if len (flags .Args ()) != 0 {
286284 return errors .New ("excess arguments" )
287285 }
288286
You can’t perform that action at this time.
0 commit comments