Browse Source

Remove unused subset of the flagset interface. (#508)

Alexey Alexandrov 5 years ago
parent
commit
f11f1df84d
No account linked to committer's email address
4 changed files with 0 additions and 67 deletions
  1. 0
    7
      driver/driver.go
  2. 0
    32
      internal/driver/driver_test.go
  3. 0
    21
      internal/driver/flags.go
  4. 0
    7
      internal/plugin/plugin.go

+ 0
- 7
driver/driver.go View File

@@ -92,13 +92,6 @@ type FlagSet interface {
92 92
 	Float64(name string, def float64, usage string) *float64
93 93
 	String(name string, def string, usage string) *string
94 94
 
95
-	// BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
96
-	// a given pointer, like the functions of the same name in package flag.
97
-	BoolVar(pointer *bool, name string, def bool, usage string)
98
-	IntVar(pointer *int, name string, def int, usage string)
99
-	Float64Var(pointer *float64, name string, def float64, usage string)
100
-	StringVar(pointer *string, name string, def string, usage string)
101
-
102 95
 	// StringList is similar to String but allows multiple values for a
103 96
 	// single flag
104 97
 	StringList(name string, def string, usage string) *[]*string

+ 0
- 32
internal/driver/driver_test.go View File

@@ -330,38 +330,6 @@ func (f testFlags) String(s, d, c string) *string {
330 330
 	return &d
331 331
 }
332 332
 
333
-func (f testFlags) BoolVar(p *bool, s string, d bool, c string) {
334
-	if b, ok := f.bools[s]; ok {
335
-		*p = b
336
-	} else {
337
-		*p = d
338
-	}
339
-}
340
-
341
-func (f testFlags) IntVar(p *int, s string, d int, c string) {
342
-	if i, ok := f.ints[s]; ok {
343
-		*p = i
344
-	} else {
345
-		*p = d
346
-	}
347
-}
348
-
349
-func (f testFlags) Float64Var(p *float64, s string, d float64, c string) {
350
-	if g, ok := f.floats[s]; ok {
351
-		*p = g
352
-	} else {
353
-		*p = d
354
-	}
355
-}
356
-
357
-func (f testFlags) StringVar(p *string, s, d, c string) {
358
-	if t, ok := f.strings[s]; ok {
359
-		*p = t
360
-	} else {
361
-		*p = d
362
-	}
363
-}
364
-
365 333
 func (f testFlags) StringList(s, d, c string) *[]*string {
366 334
 	if t, ok := f.stringLists[s]; ok {
367 335
 		// convert slice of strings to slice of string pointers before returning.

+ 0
- 21
internal/driver/flags.go View File

@@ -44,27 +44,6 @@ func (*GoFlags) String(o, d, c string) *string {
44 44
 	return flag.String(o, d, c)
45 45
 }
46 46
 
47
-// BoolVar implements the plugin.FlagSet interface.
48
-func (*GoFlags) BoolVar(b *bool, o string, d bool, c string) {
49
-	flag.BoolVar(b, o, d, c)
50
-}
51
-
52
-// IntVar implements the plugin.FlagSet interface.
53
-func (*GoFlags) IntVar(i *int, o string, d int, c string) {
54
-	flag.IntVar(i, o, d, c)
55
-}
56
-
57
-// Float64Var implements the plugin.FlagSet interface.
58
-// the value of the flag.
59
-func (*GoFlags) Float64Var(f *float64, o string, d float64, c string) {
60
-	flag.Float64Var(f, o, d, c)
61
-}
62
-
63
-// StringVar implements the plugin.FlagSet interface.
64
-func (*GoFlags) StringVar(s *string, o, d, c string) {
65
-	flag.StringVar(s, o, d, c)
66
-}
67
-
68 47
 // StringList implements the plugin.FlagSet interface.
69 48
 func (*GoFlags) StringList(o, d, c string) *[]*string {
70 49
 	return &[]*string{flag.String(o, d, c)}

+ 0
- 7
internal/plugin/plugin.go View File

@@ -61,13 +61,6 @@ type FlagSet interface {
61 61
 	Float64(name string, def float64, usage string) *float64
62 62
 	String(name string, def string, usage string) *string
63 63
 
64
-	// BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
65
-	// a given pointer, like the functions of the same name in package flag.
66
-	BoolVar(pointer *bool, name string, def bool, usage string)
67
-	IntVar(pointer *int, name string, def int, usage string)
68
-	Float64Var(pointer *float64, name string, def float64, usage string)
69
-	StringVar(pointer *string, name string, def string, usage string)
70
-
71 64
 	// StringList is similar to String but allows multiple values for a
72 65
 	// single flag
73 66
 	StringList(name string, def string, usage string) *[]*string