Repository: google/pprof
Pull request #508 (2020-02-09 07:27:04)

Remove unused subset of the flagset interface.

codecov-io: # [Codecov](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=h1) Report
> Merging [#508](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=desc) into [master](https://codecov.io/gh/google/pprof/commit/04f1013958a886bcd9074fd8da5f39477cda50e7?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/pprof/pull/508/graphs/tree.svg?width=650&token=nHgs4Smibv&height=150&src=pr)](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   67.09%   67.13%   +0.03%     
==========================================
  Files          37       37              
  Lines        7603     7603              
==========================================
+ Hits         5101     5104       +3     
+ Misses       2097     2095       -2     
+ Partials      405      404       -1
```


| [Impacted Files](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [internal/driver/driver\_focus.go](https://codecov.io/gh/google/pprof/pull/508/diff?src=pr&el=tree#diff-aW50ZXJuYWwvZHJpdmVyL2RyaXZlcl9mb2N1cy5nbw==) | `86.06% <ø> (+0.81%)` | :arrow_up: |
| [internal/report/source.go](https://codecov.io/gh/google/pprof/pull/508/diff?src=pr&el=tree#diff-aW50ZXJuYWwvcmVwb3J0L3NvdXJjZS5nbw==) | `83.24% <0%> (+0.54%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=footer). Last update [04f1013...67c62e9](https://codecov.io/gh/google/pprof/pull/508?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/driver/driver.go b/driver/driver.go
index b1c745b..9bcbc82 100644
--- a/driver/driver.go
+++ b/driver/driver.go
@@ -92,13 +92,6 @@ type FlagSet interface {
 	Float64(name string, def float64, usage string) *float64
 	String(name string, def string, usage string) *string
 
-	// BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
-	// a given pointer, like the functions of the same name in package flag.
-	BoolVar(pointer *bool, name string, def bool, usage string)
-	IntVar(pointer *int, name string, def int, usage string)
-	Float64Var(pointer *float64, name string, def float64, usage string)
-	StringVar(pointer *string, name string, def string, usage string)
-
 	// StringList is similar to String but allows multiple values for a
 	// single flag
 	StringList(name string, def string, usage string) *[]*string
diff --git a/internal/driver/flags.go b/internal/driver/flags.go
index 6ef1397..5390319 100644
--- a/internal/driver/flags.go
+++ b/internal/driver/flags.go
@@ -44,27 +44,6 @@ func (*GoFlags) String(o, d, c string) *string {
 	return flag.String(o, d, c)
 }
 
-// BoolVar implements the plugin.FlagSet interface.
-func (*GoFlags) BoolVar(b *bool, o string, d bool, c string) {
-	flag.BoolVar(b, o, d, c)
-}
-
-// IntVar implements the plugin.FlagSet interface.
-func (*GoFlags) IntVar(i *int, o string, d int, c string) {
-	flag.IntVar(i, o, d, c)
-}
-
-// Float64Var implements the plugin.FlagSet interface.
-// the value of the flag.
-func (*GoFlags) Float64Var(f *float64, o string, d float64, c string) {
-	flag.Float64Var(f, o, d, c)
-}
-
-// StringVar implements the plugin.FlagSet interface.
-func (*GoFlags) StringVar(s *string, o, d, c string) {
-	flag.StringVar(s, o, d, c)
-}
-
 // StringList implements the plugin.FlagSet interface.
 func (*GoFlags) StringList(o, d, c string) *[]*string {
 	return &[]*string{flag.String(o, d, c)}
diff --git a/internal/plugin/plugin.go b/internal/plugin/plugin.go
index a304284..4c1db23 100644
--- a/internal/plugin/plugin.go
+++ b/internal/plugin/plugin.go
@@ -61,13 +61,6 @@ type FlagSet interface {
 	Float64(name string, def float64, usage string) *float64
 	String(name string, def string, usage string) *string
 
-	// BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
-	// a given pointer, like the functions of the same name in package flag.
-	BoolVar(pointer *bool, name string, def bool, usage string)
-	IntVar(pointer *int, name string, def int, usage string)
-	Float64Var(pointer *float64, name string, def float64, usage string)
-	StringVar(pointer *string, name string, def string, usage string)
-
 	// StringList is similar to String but allows multiple values for a
 	// single flag
 	StringList(name string, def string, usage string) *[]*string


Test patch:
diff --git a/internal/driver/driver_test.go b/internal/driver/driver_test.go
index 5f7edd0..3dc7c9b 100644
--- a/internal/driver/driver_test.go
+++ b/internal/driver/driver_test.go
@@ -330,38 +330,6 @@ func (f testFlags) String(s, d, c string) *string {
 	return &d
 }
 
-func (f testFlags) BoolVar(p *bool, s string, d bool, c string) {
-	if b, ok := f.bools[s]; ok {
-		*p = b
-	} else {
-		*p = d
-	}
-}
-
-func (f testFlags) IntVar(p *int, s string, d int, c string) {
-	if i, ok := f.ints[s]; ok {
-		*p = i
-	} else {
-		*p = d
-	}
-}
-
-func (f testFlags) Float64Var(p *float64, s string, d float64, c string) {
-	if g, ok := f.floats[s]; ok {
-		*p = g
-	} else {
-		*p = d
-	}
-}
-
-func (f testFlags) StringVar(p *string, s, d, c string) {
-	if t, ok := f.strings[s]; ok {
-		*p = t
-	} else {
-		*p = d
-	}
-}
-
 func (f testFlags) StringList(s, d, c string) *[]*string {
 	if t, ok := f.stringLists[s]; ok {
 		// convert slice of strings to slice of string pointers before returning.