go.mway.dev/chrono@v0.6.1-0.20240126030049-189c5aef20d2/justfile (about)

     1  #!/usr/bin/env just --justfile
     2  
     3  coverprofile := "cover.out"
     4  
     5  default:
     6      @just --list | grep -v default
     7  
     8  test PKG="./..." *ARGS="":
     9      go test -race -failfast -count 1 -coverprofile {{ coverprofile }} {{ PKG }} {{ ARGS }}
    10  
    11  vtest PKG="./..." *ARGS="": (test PKG ARGS "-v")
    12  
    13  tests PKG="./..." *ARGS="":
    14      gotestsum -f dots -- -v -race -failfast -count 1 -coverprofile {{ coverprofile }} {{ PKG }} {{ ARGS }}
    15  
    16  cover: test
    17      go tool cover -html {{ coverprofile }}
    18  
    19  alias benchmark := bench
    20  
    21  bench PKG="./..." *ARGS="":
    22      go test -v -count 1 -run x -bench . {{ PKG }} {{ ARGS }}
    23  
    24  lint PKG="./...":
    25      golangci-lint run --new=false {{ PKG }}
    26  
    27  mockgen:
    28      command mockgen >/dev/null 2>&1 || go install github.com/golang/mock/mockgen@latest
    29  
    30  generate PKG="./...": mockgen
    31      go generate {{ PKG }}