diff --git a/main.go b/main.go index 8f9a926852..fc93740ea8 100644 --- a/main.go +++ b/main.go @@ -166,13 +166,3 @@ func main() { log.Println("Error:", err) } } - -func initialize(c *cli.Context) error { - fmt.Println(c.String("root-dir")) - err := os.MkdirAll(c.String("root-dir"), constant.DefaultDirMode) - if err != nil { - return errors.Wrap(err, "make root directory") - } - - return nil -} diff --git a/pkg/update/update.go b/pkg/update/update.go index 979a91b767..8aeb836aad 100644 --- a/pkg/update/update.go +++ b/pkg/update/update.go @@ -27,9 +27,8 @@ const ( // Updater is responsible for managing update state. type Updater struct { - opt Options - transport *http.Transport - client *client.Client + opt Options + client *client.Client } // Options are the options that can be provided when creating an Updater. @@ -122,7 +121,7 @@ func makeLocalPath(name, platform, version string) string { func (u *Updater) Lookup(name, platform, version string) (*data.TargetFileMeta, error) { target, err := u.client.Target(makeRepoPath(name, platform, version)) if err != nil { - return nil, errors.Wrapf(err, "lookup target %s", target) + return nil, errors.Wrapf(err, "lookup target %v", target) } return &target, nil diff --git a/pkg/update/update_test.go b/pkg/update/update_test.go index 84f148480d..3a5333a969 100644 --- a/pkg/update/update_test.go +++ b/pkg/update/update_test.go @@ -33,7 +33,7 @@ func assertDir(t *testing.T, path string) { assert.True(t, info.IsDir()) } -func TestMakePath(t *testing.T) { +func TestMakeRepoPath(t *testing.T) { t.Parallel() testCases := []struct { @@ -50,7 +50,7 @@ func TestMakePath(t *testing.T) { t.Run(tt.expected, func(t *testing.T) { t.Parallel() - assert.Equal(t, tt.expected, makePath(tt.name, tt.platform, tt.version)) + assert.Equal(t, tt.expected, makeRepoPath(tt.name, tt.platform, tt.version)) }) } }