Browse Source

Simplify Bool, Int, String helpers.

Code simplification suggestion by @gmlewis.

Closes #350
Dmitri Shuralyov 10 years ago
committed by Will Norris
parent
commit
4c532303a6
1 changed files with 3 additions and 15 deletions
  1. +3
    -15
      github/github.go

+ 3
- 15
github/github.go View File

@ -760,24 +760,12 @@ func cloneRequest(r *http.Request) *http.Request {
// Bool is a helper routine that allocates a new bool value
// to store v and returns a pointer to it.
func Bool(v bool) *bool {
p := new(bool)
*p = v
return p
}
func Bool(v bool) *bool { return &v }
// Int is a helper routine that allocates a new int value
// to store v and returns a pointer to it.
func Int(v int) *int {
p := new(int)
*p = v
return p
}
func Int(v int) *int { return &v }
// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
func String(v string) *string {
p := new(string)
*p = v
return p
}
func String(v string) *string { return &v }

Loading…
Cancel
Save