From c73a9c1c25a84d3dd579c7354ec49d8c49c93ebd Mon Sep 17 00:00:00 2001 From: forest Date: Thu, 11 Mar 2021 14:34:19 -0600 Subject: [PATCH] update to go version 16 --- Dockerfile | 10 +++++----- build-docker.sh | 2 +- go.mod | 8 ++++++++ go.sum | 10 ++++++++++ main.go | 4 ++-- 5 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/Dockerfile b/Dockerfile index fe6fe72..e29f7d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ -FROM golang:1.15.2-alpine as build +FROM golang:1.16-alpine as build ARG GOARCH= ARG GO_BUILD_ARGS= RUN mkdir /build WORKDIR /build -RUN apk add --update --no-cache ca-certificates git \ - && go get golang.org/x/crypto/scrypt \ - && go get github.com/pkg/errors +RUN apk add --update --no-cache ca-certificates git +COPY go.mod go.mod +COPY go.sum go.sum COPY main.go main.go -RUN go build -v $GO_BUILD_ARGS -o /build/sequentialread-pow-captcha . +RUN go get && go build -v $GO_BUILD_ARGS -o /build/sequentialread-pow-captcha . FROM alpine WORKDIR /app diff --git a/build-docker.sh b/build-docker.sh index 4c11a36..42857dc 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -VERSION="0.0.9" +VERSION="0.0.10" rm -rf dockerbuild || true mkdir dockerbuild diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..295f566 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module git.sequentialread.com/forest/sequentialread-pow-captcha + +go 1.16 + +require ( + git.sequentialread.com/forest/pkg-errors v0.9.2 // indirect + golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..5e70547 --- /dev/null +++ b/go.sum @@ -0,0 +1,10 @@ +git.sequentialread.com/forest/pkg-errors v0.9.2 h1:j6pwbL6E+TmE7TD0tqRtGwuoCbCfO6ZR26Nv5nest9g= +git.sequentialread.com/forest/pkg-errors v0.9.2/go.mod h1:8TkJ/f8xLWFIAid20aoqgDZcCj9QQt+FU+rk415XO1w= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/main.go b/main.go index 3106a99..7a15ab7 100644 --- a/main.go +++ b/main.go @@ -19,7 +19,7 @@ import ( "strings" "time" - "github.com/pkg/errors" + errors "git.sequentialread.com/forest/pkg-errors" "golang.org/x/crypto/scrypt" ) @@ -159,7 +159,7 @@ func main() { for _, fileInfo := range fileInfos { filenameSplit := strings.Split(fileInfo.Name(), "_") - if len(filenameSplit) != 2 { + if len(filenameSplit) == 2 { filepath := path.Join(apiTokensFolder, fileInfo.Name()) content, err := ioutil.ReadFile(filepath) if err != nil {