Skip to content

Commit

Permalink
refactor: rename getTags to getImages
Browse files Browse the repository at this point in the history
  • Loading branch information
shivjm committed Nov 7, 2021
1 parent c6ea5a2 commit e45de00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions main.go
Expand Up @@ -37,7 +37,7 @@ func main() {
log.Fatalf("Could not parse Dockerfile: %s\n", err)
}

images := getTags(parsed, unknownMarker)
images := getImages(parsed, unknownMarker)

val, err := json.Marshal(images)

Expand Down Expand Up @@ -82,8 +82,8 @@ func getInput(args []string) (*os.File, error) {
return os.Stdin, nil
}

// getTags returns the `Image`s used in the given sets of Dockerfile commands.
func getTags(commands []dockerfile.Command, unknownMarker string) []Image {
// getImages returns the `Image`s used in the given sets of Dockerfile commands.
func getImages(commands []dockerfile.Command, unknownMarker string) []Image {
images := []Image{}

for _, cmd := range commands {
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Expand Up @@ -23,7 +23,7 @@ func TestParsing(t *testing.T) {
t.Errorf("Could not open Dockerfile.1: %s", err)
}

tags := getTags(commands, " * ")
tags := getImages(commands, " * ")

assert.Equal(t, expected, tags)
}
Expand All @@ -46,7 +46,7 @@ func TestQuery(t *testing.T) {
t.Errorf("Could not open Dockerfile.1: %s", err)
}

tags := getTags(commands, "?")
tags := getImages(commands, "?")

for _, c := range cases {
result, err := getSingleTag(tags, c.query)
Expand Down

0 comments on commit e45de00

Please sign in to comment.