Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcel-dempers committed Jan 31, 2021
1 parent 138a127 commit e3dfa21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions golang/introduction/part-4.commandline/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
# 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" ]
4 changes: 2 additions & 2 deletions golang/introduction/part-4.commandline/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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 <subcommand>` arguments:

```
addCmd.Parse(os.Args[2:])
getCmd.Parse(os.Args[2:])
```

## Input Validation
Expand Down

0 comments on commit e3dfa21

Please sign in to comment.