diff --git a/golang/introduction/part-4.commandline/dockerfile b/golang/introduction/part-4.commandline/dockerfile index 49ef14f..af2518a 100644 --- a/golang/introduction/part-4.commandline/dockerfile +++ b/golang/introduction/part-4.commandline/dockerfile @@ -2,16 +2,16 @@ FROM golang:1.15-alpine as dev WORKDIR /work -FROM golang:1.15-alpine as build +# FROM golang:1.15-alpine as build -WORKDIR /videos -COPY ./videos/* /videos/ -RUN go build -o videos +# WORKDIR /videos +# COPY ./videos/* /videos/ +# RUN go build -o videos -FROM alpine as runtime -COPY --from=build /videos/videos /usr/local/bin/videos -COPY ./videos/videos.json / -COPY run.sh / -RUN chmod +x /run.sh -ENTRYPOINT [ "./run.sh" ] \ No newline at end of file +# FROM alpine as runtime +# COPY --from=build /videos/videos /usr/local/bin/videos +# COPY ./videos/videos.json / +# COPY run.sh / +# RUN chmod +x /run.sh +# ENTRYPOINT [ "./run.sh" ] \ No newline at end of file diff --git a/golang/introduction/part-4.commandline/readme.md b/golang/introduction/part-4.commandline/readme.md index b2c93e1..5a29a50 100644 --- a/golang/introduction/part-4.commandline/readme.md +++ b/golang/introduction/part-4.commandline/readme.md @@ -208,7 +208,7 @@ Let's define our subcommands in `main.go` : ``` When a user runs our videos CLI tool, we may need to validate that -our application receives the right subcommands. So lets ensure add simple validation to check if the user has passed a subcommand +our application receives the right subcommands. So lets ensure a simple validation to check if the user has passed a subcommand To check the arguments passed to our CLI, we use the ["os"](https://golang.org/pkg/os/) package. Check the Args variable, it holds usefull information passed to our application including its name. `var Args []string` @@ -259,7 +259,7 @@ Now that we have seperate functions for each subcommand, we can take appropriate This allows us to parse everything after the `videos ` arguments: ``` -addCmd.Parse(os.Args[2:]) +getCmd.Parse(os.Args[2:]) ``` ## Input Validation