❯ ./dist/rpath --help
rpath - find path of the element present at specified position
Usage:
rpath [flags] CATEGORY [FILE]
Available CATEGORY:
- yaml, yml
- json
Flags:
-column int
Column number of target, 1-based
-debug
Enable debug logs
-line int
Line number of target, 1-based
-offset int
Offset of target, 0-based (default -1)
-verbose
Verbose output
❯ cat - <<EOS | rpath -line 6 -column 10 yaml
apiVersion: v1
kind: Text
metadata:
name: sometext
spec:
text1: テキスト
text2: text
EOS
$.spec.text1
❯ cat - <<EOS | rpath -line 8 -column 14 json
{
"apiVersion": "v1",
"kind": "Text",
"metadata": {
"name": "sometext"
},
"spec": {
"text1": "テキスト",
"text2": "text"
}
}
EOS
.["spec"]["text1"]
Requires: lint, test, build
Run unit tests and e2e tests.
go test -v -cover -race ./...
Build executable binary to dist/rpath
.
./xc buildx "" ""
Build executable binary to dist/rpath
.
Inputs: os, arch
goos=${os:-$(go env GOOS)}
goarch=${arch:-$(go env GOARCH)}
GOOS="$goos" GOARCH="$goarch" go build -trimpath -v -o dist/rpath ./cmd/rpath
Run linters.
Requires: vet, vuln
Examine code.
go vet ./...
Find vulnerabilities.
go run golang.org/x/vuln/cmd/govulncheck ./...
Requires: docker-lint, docker-test, docker-build
Build executable binary to dist/rpath
.
export os="$(go env GOOS)"
export arch="$(go env GOARCH)"
./xc docker-buildx
Build executable binary to dist/rpath
.
Inputs: os, arch
docker build --progress plain --target build --build-arg os=$os --build-arg arch=$arch -o dist .
Run unit tests and e2e tests.
docker build --progress plain --target test .
Run linters.
Requires: docker-vet, docker-vuln
Examine code.
docker build --progress plain --target vet .
Find vulnerabilities.
docker build --progress plain --target vuln .