Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Dec 23, 2022
1 parent 9e37975 commit 9d5e2be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/oras/internal/fileref/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ limitations under the License.
package fileref

import (
"strings"
"fmt"
"strings"
)

// Parse parses file reference on unix.
func Parse(reference string, defaultMediaType string) (filePath, mediaType string, err error) {
filePath = reference
mediaType = defaultMediaType
i := strings.LastIndex(reference, ":")
if i >= 0 {
if i < 0 {
filePath, mediaType = reference, defaultMediaType
} else {
filePath, mediaType = reference[:i], reference[i+1:]
}
if filePath == "" {
Expand Down

0 comments on commit 9d5e2be

Please sign in to comment.