Check if file listing is a directory, verbose build
This commit is contained in:
parent
18fbe7d340
commit
672d102d46
|
@ -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 .
|
||||
|
||||
...
|
||||
|
|
|
@ -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"]
|
|
@ -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{
|
||||
|
|
Loading…
Reference in a new issue