Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Mar 28, 2024
1 parent 74de747 commit 80b2a3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/oras/internal/option/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (opts *Target) Parse() error {
opts.Type = TargetTypeRemote
if _, err := registry.ParseReference(opts.RawReference); err != nil {
return &oerrors.Error{
Err: fmt.Errorf("%w: %q", err, opts.RawReference),
Err: fmt.Errorf("%q: %w", opts.RawReference, err),
Recommendation: "Please make sure the provided reference is in the form of <registry>/<repo>[:tag|@digest]",
}
}
Expand All @@ -120,14 +120,14 @@ func (opts *Target) parseOCILayoutReference() error {
raw := opts.RawReference
var path string
var ref string
var err error

if idx := strings.LastIndex(raw, "@"); idx != -1 {
// `digest` found
path = raw[:idx]
ref = raw[idx+1:]
} else {
// find `tag`
var err error
path, ref, err = fileref.Parse(raw, "")
if err != nil {
err = errors.Join(err, errdef.ErrInvalidReference)
Expand Down

0 comments on commit 80b2a3b

Please sign in to comment.