Replace fmt.Sprint with strconv.Itoa, specify slice capacity
Uber's Go style guide outlines a slight performance benefit when using strconv over fmt: https://github.com/uber-go/guide/blob/dc025303c14891f54d1847396379548773e6123e/style.md#prefer-strconv-over-fmt Also specifiying slice capacity when it is known beforehand: https://github.com/uber-go/guide/blob/dc025303c14891f54d1847396379548773e6123e/style.md#specifying-slice-capacity Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
+1
-1
@@ -339,7 +339,7 @@ func (s *PostService) PinToProfile(ctx context.Context, id string) (*Response, e
|
||||
form.Set("id", id)
|
||||
form.Set("state", "true")
|
||||
form.Set("to_profile", "true")
|
||||
// form.Set("num", fmt.Sprint(pos))
|
||||
// form.Set("num", strconv.Itoa(pos))
|
||||
|
||||
req, err := s.client.NewRequest(http.MethodPost, path, form)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user