diff --git a/pkg/export/export.go b/pkg/export/export.go index bf06e04..33c472f 100644 --- a/pkg/export/export.go +++ b/pkg/export/export.go @@ -5,19 +5,20 @@ import ( "errors" "flag" "fmt" - "github.com/genshen/cmds" - "github.com/genshen/pkg" - "github.com/mholt/archives" - log "github.com/sirupsen/logrus" "os" "path/filepath" "strings" "time" + + "github.com/genshen/cmds" + "github.com/genshen/pkg" + "github.com/mholt/archives" + log "github.com/sirupsen/logrus" ) var exportCommand = &cmds.Command{ Name: "export", - Summary: "export dependency packages export a tarball file", + Summary: "export dependency packages to a tarball file", Description: "export dependency packages to a tarball file (.tar) specified by a file path", CustomFlags: false, HasOptions: true, diff --git a/pkg/fetch/cache_strategy.go b/pkg/fetch/cache_strategy.go index 56ae58b..b6d7a48 100644 --- a/pkg/fetch/cache_strategy.go +++ b/pkg/fetch/cache_strategy.go @@ -11,7 +11,7 @@ const ( CacheStrategyCopyFromGlobalCache CacheStrategy = iota // package exits at user home's global cache directory. CacheStrategyUserLocalVendor CacheStrategy = iota // package exist in project's vendor/src directory. CacheStrategySkip CacheStrategy = iota // skip package downloading or local copying - CacheStrategyDefault CacheStrategy = CacheStrategyDownloadFromRemote // package exist in project's vendor/src directory. + CacheStrategyDefault = CacheStrategyDownloadFromRemote // package exist in project's vendor/src directory. ) type CacheStrategy int @@ -29,7 +29,7 @@ func determinePackageCacheStrategy(packageMeta pkg.PackageMeta, projectRoot stri return nil, CacheStrategyDownloadFromRemote } return err, CacheStrategySkip - } else { // vendor src does not exist, but global cache exist. + } else { // vendor src does not exist, but global cache exist. if noCache { // if noCache, directly download. Don't use global cache. return err, CacheStrategyDownloadFromRemote } diff --git a/pkg/fetch/cmake_lib.go b/pkg/fetch/cmake_lib.go index 790674a..2007539 100644 --- a/pkg/fetch/cmake_lib.go +++ b/pkg/fetch/cmake_lib.go @@ -3,13 +3,14 @@ package fetch import ( "bufio" "fmt" - "github.com/genshen/pkg" - log "github.com/sirupsen/logrus" "io" "os" "path/filepath" "strings" "text/template" + + "github.com/genshen/pkg" + log "github.com/sirupsen/logrus" ) type cmakeDepData struct { diff --git a/pkg/fetch/features.go b/pkg/fetch/features.go index a7983fd..e84532a 100644 --- a/pkg/fetch/features.go +++ b/pkg/fetch/features.go @@ -2,8 +2,9 @@ package fetch import ( "fmt" - "github.com/genshen/pkg" "log" + + "github.com/genshen/pkg" ) const FEATURE_DEBUG = true diff --git a/pkg/fetch/fetch.go b/pkg/fetch/fetch.go index d732404..a411630 100644 --- a/pkg/fetch/fetch.go +++ b/pkg/fetch/fetch.go @@ -5,6 +5,12 @@ import ( "errors" "flag" "fmt" + "io" + "os" + "path/filepath" + "strings" + "text/template" + "github.com/AlecAivazis/survey/v2" "github.com/genshen/cmds" "github.com/genshen/pkg" @@ -13,11 +19,6 @@ import ( "github.com/rogpeppe/go-internal/semver" log "github.com/sirupsen/logrus" "gopkg.in/yaml.v3" - "io" - "os" - "path/filepath" - "strings" - "text/template" ) var fetchCommand = &cmds.Command{ diff --git a/pkg/fetch/src_dl.go b/pkg/fetch/src_dl.go index 1f239b6..17ffb10 100644 --- a/pkg/fetch/src_dl.go +++ b/pkg/fetch/src_dl.go @@ -157,7 +157,7 @@ func archiveSrc(archiveType string, srcPath string, packageName string, remoteUr archiveType = pkg.DefaultArchiveFormatType log.WithFields(log.Fields{ "pkg": packageName, - }).Info("set archive package format type to default type: %s.", archiveType) + }).Infof("set archive package format type to default type: %s.", archiveType) } // save file. @@ -267,7 +267,7 @@ func gitSrc(auths map[string]conf.Auth, packageCacheDir, packagePath, packageUrl URL: proxyUrl, }, }); err != nil { - log.Println("Error here", err) + log.Println("Error here", err, repoUrl) return err } else { // clone succeed. // set filemode to false for Windows system diff --git a/pkg/import/import.go b/pkg/import/import.go index 94a3ca1..bedd846 100644 --- a/pkg/import/import.go +++ b/pkg/import/import.go @@ -5,13 +5,14 @@ import ( "errors" "flag" "fmt" + "os" + "path/filepath" + "github.com/genshen/cmds" "github.com/genshen/pkg" "github.com/mholt/archives" cp "github.com/otiai10/copy" log "github.com/sirupsen/logrus" - "os" - "path/filepath" ) const ImportCacheDir = ".import.cache" @@ -19,7 +20,7 @@ const ImportCacheDir = ".import.cache" var importCommand = &cmds.Command{ Name: "import", Summary: "import dependency packages from tarball file", - Description: "import and extract dependency packages from tarball file (.tar) specified by a file path", + Description: "import and extract dependency packages from tarball file (.tar.gz) specified by a file path", CustomFlags: false, HasOptions: true, } diff --git a/pkg/init/init.go b/pkg/init/init.go index 40943e8..4d0c738 100644 --- a/pkg/init/init.go +++ b/pkg/init/init.go @@ -3,11 +3,12 @@ package init import ( "errors" "flag" + "os" + "path/filepath" + "github.com/genshen/cmds" "github.com/genshen/pkg" "gopkg.in/yaml.v3" - "os" - "path/filepath" ) var initCommand = &cmds.Command{ diff --git a/pkg/install/build_pkg.go b/pkg/install/build_pkg.go index 9eb3f5f..1a41053 100644 --- a/pkg/install/build_pkg.go +++ b/pkg/install/build_pkg.go @@ -2,8 +2,9 @@ package install import ( "fmt" - "github.com/genshen/pkg" "strings" + + "github.com/genshen/pkg" ) // build pkg from dependency tree. diff --git a/pkg/install/command.go b/pkg/install/command.go index 3f4d142..24d2f1a 100644 --- a/pkg/install/command.go +++ b/pkg/install/command.go @@ -3,13 +3,14 @@ package install import ( "errors" "fmt" - "github.com/genshen/pkg" - log "github.com/sirupsen/logrus" "io" "os" "os/exec" "path/filepath" "strings" + + "github.com/genshen/pkg" + log "github.com/sirupsen/logrus" ) // run the instruction diff --git a/pkg/install/install.go b/pkg/install/install.go index 8191caf..862b50f 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -5,10 +5,11 @@ import ( "errors" "flag" "fmt" + "os" + "github.com/genshen/cmds" "github.com/genshen/pkg" log "github.com/sirupsen/logrus" - "os" ) var buildCommand = &cmds.Command{ diff --git a/pkg/install/install_shell.go b/pkg/install/install_shell.go index e511a39..e66ef60 100644 --- a/pkg/install/install_shell.go +++ b/pkg/install/install_shell.go @@ -4,10 +4,11 @@ import ( "bufio" "errors" "fmt" - "github.com/genshen/pkg" "os" "path/filepath" "strings" + + "github.com/genshen/pkg" ) // writer instructions as shell format to file diff --git a/pkg/list/list.go b/pkg/list/list.go index e5714e2..45be1ed 100644 --- a/pkg/list/list.go +++ b/pkg/list/list.go @@ -4,10 +4,11 @@ import ( "errors" "flag" "fmt" - "github.com/genshen/cmds" - "github.com/genshen/pkg" "os" "sort" + + "github.com/genshen/cmds" + "github.com/genshen/pkg" ) var listCommand = &cmds.Command{ diff --git a/pkg/version/version.go b/pkg/version/version.go index 77d2759..9b8e958 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -3,6 +3,7 @@ package version import ( "flag" "fmt" + "github.com/genshen/cmds" "github.com/genshen/pkg" ) @@ -16,8 +17,8 @@ var versionCommand = &cmds.Command{ } var ( - GitCommitID string = "unknown" - BuildTime string = "" + GitCommitID = "unknown" + BuildTime = "" ) func init() {