mirror of
https://github.com/docker/cli.git
synced 2026-09-25 07:50:37 -05:00
Refactoring ineffectual assignments
This patch fixed below 4 types of code line 1. Remove unnecessary variable assignment 2. Use variables declaration instead of explicit initial zero value 3. Change variable name to underbar when variable not used 4. Add erro check and return for ignored error Signed-off-by: Daehyeok Mun <daehyeok@gmail.com> Upstream-commit: 6306019d0bad9c4e60ee437e93f2450dfb0b68c0 Component: engine
This commit is contained in:
@@ -79,8 +79,8 @@ func ToParamWithVersion(version string, a Args) (string, error) {
|
||||
}
|
||||
|
||||
// for daemons older than v1.10, filter must be of the form map[string][]string
|
||||
buf := []byte{}
|
||||
err := errors.New("")
|
||||
var buf []byte
|
||||
var err error
|
||||
if version != "" && versions.LessThan(version, "1.22") {
|
||||
buf, err = json.Marshal(convertArgsToSlice(a.fields))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user