Skip to content

Commit

Permalink
fix: fix typo (#548)
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe authored Nov 18, 2024
1 parent 840dc89 commit 7b13434
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions pkg/client/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestAddWithModSpec(t *testing.T) {
name: "TestAddOciWithNoTag",
pkgSubPath: "no_oci_ref",
sourceUrl: "oci://ghcr.io/kcl-lang/helloworld",
msg: "the lastest version '0.1.4' will be downloaded" +
msg: "the latest version '0.1.4' will be downloaded" +
"downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'" +
"adding dependency 'helloworld'" +
"add dependency 'helloworld:0.1.4' successfully",
Expand All @@ -104,7 +104,7 @@ func TestAddWithModSpec(t *testing.T) {
name: "TestAddGitWithNoTag",
pkgSubPath: "no_git_ref",
sourceUrl: "git://github.com/kcl-lang/flask-demo-kcl-manifests.git",
msg: "the lastest version 'ade147b' will be downloaded" +
msg: "the latest version 'ade147b' will be downloaded" +
"cloning 'https://github.com/kcl-lang/flask-demo-kcl-manifests.git' with commit 'ade147b'" +
"adding dependency 'flask_manifests'" +
"add dependency 'flask_manifests:0.0.1' successfully",
Expand Down Expand Up @@ -306,7 +306,7 @@ func TestAddWithOnlyModSpec(t *testing.T) {
name: "TestAddWithOnlyModSpecButNoVersion",
testDir: "add_with_mod_spec",
pkgSubDir: "spec_only_no_ver",
msg: "the lastest version '0.1.4' will be downloaded" +
msg: "the latest version '0.1.4' will be downloaded" +
"downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'" +
"adding dependency 'helloworld'" +
"add dependency 'helloworld:0.1.4' successfully",
Expand Down Expand Up @@ -461,7 +461,7 @@ func TestAddRenameWithNoSpec(t *testing.T) {
)

assert.Equal(t,
"the lastest version '0.1.4' will be downloaded"+
"the latest version '0.1.4' will be downloaded"+
"downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'"+
"adding dependency 'helloworld'"+
"add dependency 'helloworld:0.1.4' successfully",
Expand Down
14 changes: 7 additions & 7 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func (c *KpmClient) resolvePkgDeps(kclPkg *pkg.KclPkg, lockDeps *pkg.Dependencie
// If not under the mode of '--no_sum_check',
// all the dependencies in kcl.mod.lock are the dependencies of the current package.
//
// alian the dependencies between kcl.mod and kcl.mod.lock
// align the dependencies between kcl.mod and kcl.mod.lock
// clean the dependencies in kcl.mod.lock which not in kcl.mod
// clean the dependencies in kcl.mod.lock and kcl.mod which have different version
for _, name := range kclPkg.Dependencies.Deps.Keys() {
Expand Down Expand Up @@ -845,7 +845,7 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*
if dep.Source.Oci != nil {
ociSource = dep.Source.Oci
}
// Select the latest tag, if the tag, the user inputed, is empty.
// Select the latest tag, if the tag, the user inputted, is empty.
if ociSource.Tag == "" || ociSource.Tag == constants.LATEST {
latestTag, err := c.AcquireTheLatestOciVersion(*ociSource)
if err != nil {
Expand Down Expand Up @@ -1044,7 +1044,7 @@ func (c *KpmClient) DownloadPkgFromOci(dep *downloader.Oci, localPath string) (*
}

ociClient.SetLogWriter(c.logWriter)
// Select the latest tag, if the tag, the user inputed, is empty.
// Select the latest tag, if the tag, the user inputted, is empty.
var tagSelected string
if len(dep.Tag) == 0 {
tagSelected, err = ociClient.TheLatestTag()
Expand All @@ -1053,7 +1053,7 @@ func (c *KpmClient) DownloadPkgFromOci(dep *downloader.Oci, localPath string) (*
}

reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be added", tagSelected),
fmt.Sprintf("the latest version '%s' will be added", tagSelected),
c.logWriter,
)

Expand Down Expand Up @@ -1241,7 +1241,7 @@ func (c *KpmClient) LogoutOci(hostname string) error {
return nil
}

// ParseOciRef will parser '<repo_name>:<repo_tag>' into an 'OciOptions'.
// ParseOciRef will parse '<repo_name>:<repo_tag>' into an 'OciOptions'.
func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error) {
oci_address := strings.Split(ociRef, constants.OCI_SEPARATOR)
if len(oci_address) == 1 {
Expand All @@ -1260,7 +1260,7 @@ func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error) {
}
}

// ParseOciOptionFromString will parser '<repo_name>:<repo_tag>' into an 'OciOptions' with an OCI registry.
// ParseOciOptionFromString will parse '<repo_name>:<repo_tag>' into an 'OciOptions' with an OCI registry.
// the default OCI registry is 'docker.io'.
// if the 'ociUrl' is only '<repo_name>', ParseOciOptionFromString will take 'latest' as the default tag.
func (c *KpmClient) ParseOciOptionFromString(oci string, tag string) (*opt.OciOptions, error) {
Expand Down Expand Up @@ -1522,7 +1522,7 @@ func (c *KpmClient) pullTarFromOci(localPath string, ociOpts *opt.OciOptions) er
return err
}
reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected),
fmt.Sprintf("the latest version '%s' will be pulled", tagSelected),
c.logWriter,
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/deperated.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (c *KpmClient) DownloadFromOci(dep *downloader.Oci, localPath string) (stri
return "", err
}
ociClient.SetLogWriter(c.logWriter)
// Select the latest tag, if the tag, the user inputed, is empty.
// Select the latest tag, if the tag, the user inputted, is empty.
var tagSelected string
if len(dep.Tag) == 0 {
tagSelected, err = ociClient.TheLatestTag()
Expand All @@ -196,7 +196,7 @@ func (c *KpmClient) DownloadFromOci(dep *downloader.Oci, localPath string) (stri
}

reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be added", tagSelected),
fmt.Sprintf("the latest version '%s' will be added", tagSelected),
c.logWriter,
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (d *OciDownloader) Download(opts *DownloadOptions) error {
}

reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be downloaded", tagSelected),
fmt.Sprintf("the latest version '%s' will be downloaded", tagSelected),
opts.LogWriter,
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func Pull(localPath, hostName, repoName, tag string, settings *settings.Settings
return err
}
reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected),
fmt.Sprintf("the latest version '%s' will be pulled", tagSelected),
os.Stdout,
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/visitor/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (rv *RemoteVisitor) Visit(s *downloader.Source, v visitFunc) error {
}

reporter.ReportMsgTo(
fmt.Sprintf("the lastest version '%s' will be downloaded", latest),
fmt.Sprintf("the latest version '%s' will be downloaded", latest),
rv.LogWriter,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
start to pull 'oci://localhost:5001/test/k8s'
the lastest version '1.31.2' will be pulled
the latest version '1.31.2' will be pulled
pulling '/test/k8s:1.31.2' from 'localhost:5001/test/k8s'
pulled 'oci://localhost:5001/test/k8s' in '<workspace>/localhost:5001/test/k8s' successfully
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
start to pull 'k8s'
the lastest version '1.31.2' will be pulled
the latest version '1.31.2' will be pulled
pulling 'test/k8s:1.31.2' from 'localhost:5001/test/k8s'
pulled 'k8s' in '<workspace>/localhost:5001/test/k8s' successfully
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
start to pull 'oci://localhost:5001/test/helloworld'
the lastest version '0.1.2' will be pulled
the latest version '0.1.2' will be pulled
pulling '/test/helloworld:0.1.2' from 'localhost:5001/test/helloworld'
pulled 'oci://localhost:5001/test/helloworld' in '<workspace>/localhost:5001/test/helloworld' successfully

0 comments on commit 7b13434

Please sign in to comment.