filestat
This commit is contained in:
parent
58e8676a01
commit
d777d9d378
|
@ -1,40 +0,0 @@
|
|||
name: Security
|
||||
|
||||
env:
|
||||
TZ: Etc/GMT-8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
scan:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['1.19.13', '>=1.20']
|
||||
fail-fast: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go ${{ matrix.go }}
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: false
|
||||
|
||||
- name: Generate Test File
|
||||
run: |
|
||||
mkdir testfile
|
||||
dd if=/dev/zero of=testfile/testFile1 bs=4KB count=4
|
||||
|
||||
- name: Run GoSec
|
||||
uses: https://github.com/securego/gosec@master
|
||||
with:
|
||||
args: -exclude=G401,G501,G505 ./...
|
|
@ -13,7 +13,7 @@ on:
|
|||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
uint:
|
||||
testing:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['1.19.13', '>=1.20']
|
||||
|
@ -38,3 +38,13 @@ jobs:
|
|||
- name: Run Tests
|
||||
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
|
||||
|
||||
- name: Run GolangCI-Lint
|
||||
uses: https://github.com/golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.54
|
||||
args: --timeout=5m
|
||||
|
||||
- name: Run GoSec
|
||||
uses: https://github.com/securego/gosec@master
|
||||
with:
|
||||
args: -exclude=G401,G501,G505 ./...
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
name: Verify
|
||||
|
||||
env:
|
||||
TZ: Etc/GMT-8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
lint:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['1.19.13', '>=1.20']
|
||||
fail-fast: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go ${{ matrix.go }}
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: false
|
||||
|
||||
- name: Generate Test File
|
||||
run: |
|
||||
mkdir testfile
|
||||
dd if=/dev/zero of=testfile/testFile1 bs=4KB count=4
|
||||
|
||||
- name: Run GolangCI-Lint
|
||||
uses: https://github.com/golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.54
|
||||
args: --timeout=5m
|
||||
|
|
@ -28,7 +28,7 @@ func ExampleFileStat() {
|
|||
if FileStat("testfile/testFile2").NotExist() {
|
||||
fmt.Println("testfile/testFile2 not exist")
|
||||
}
|
||||
|
||||
|
||||
// Output:
|
||||
// testfile is dir
|
||||
// testfile/testFile1 is file
|
||||
|
|
Loading…
Reference in New Issue