diff --git a/.drone.yml b/.drone.yml index fee4b70..9ae0d9d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,6 +7,6 @@ steps: - name: backend image: golang:1.18-rc-bullseye commands: - - go build -o srg . + - GOAMD64=v2 go build -v -o srg . ... diff --git a/Dockerfile b/Dockerfile index 9aa81b2..318d037 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM golang:1.17-bullseye +FROM golang:1.18-rc-bullseye COPY . /src WORKDIR /src -RUN go build -o srg . && mv srg /usr/bin && rm -rf /src +RUN GOAMD64=v2 go build -v -o srg . && mv srg /usr/bin && rm -rf /src WORKDIR / ENTRYPOINT ["/usr/bin/srg"] \ No newline at end of file diff --git a/SynchRoGazer.go b/SynchRoGazer.go index e095f91..e8010a2 100644 --- a/SynchRoGazer.go +++ b/SynchRoGazer.go @@ -35,6 +35,15 @@ func HashFile(results chan<- HashFileResult, md5hasher *md5simd.Hasher, sha256ha } return } + + if fi.IsDir() { + results <- HashFileResult{ + Error: fmt.Errorf("path %s is a directory", path), + Path: path, + } + return + } + fh, err := os.Open(path) if err != nil { results <- HashFileResult{