diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7401bbe..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/golang:latest - working_directory: /go/src/github.com/koron-go/dialsrv - steps: - - checkout - - run: go get -v -t -d ./... - - run: go test -v ./... diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7745062 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..63e9b4b --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,29 @@ +name: Go + +on: [push] + +env: + GO_VERSION: '>=1.21.0' + +jobs: + + build: + name: Build + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - run: go test + + - run: go build + +# based on: github.com/koron-go/_skeleton/.github/workflows/go.yml diff --git a/.gitignore b/.gitignore index ec90525..1519234 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +*~ +default.pgo tags tmp/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..876c2e5 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +TEST_PACKAGE ?= ./... + +.PHONY: build +build: + go build -gcflags '-e' + +.PHONY: test +test: + go test $(TEST_PACKAGE) + +.PHONY: bench +bench: + go test -bench $(TEST_PACKAGE) + +.PHONY: tags +tags: + gotags -f tags -R . + +.PHONY: cover +cover: + mkdir -p tmp + go test -coverprofile tmp/_cover.out $(TEST_PACKAGE) + go tool cover -html tmp/_cover.out -o tmp/cover.html + +.PHONY: checkall +checkall: vet staticcheck + +.PHONY: vet +vet: + go vet $(TEST_PACKAGE) + +.PHONY: staticcheck +staticcheck: + staticcheck $(TEST_PACKAGE) + +.PHONY: clean +clean: + go clean + rm -f tags + rm -f tmp/_cover.out tmp/cover.html + +# based on: github.com/koron-go/_skeleton/Makefile diff --git a/README.md b/README.md index b8e3e81..1091027 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # koron-go/dialsrv -[![GoDoc](https://godoc.org/github.com/koron-go/dialsrv?status.svg)](https://godoc.org/github.com/koron-go/dialsrv) -[![CircleCI](https://img.shields.io/circleci/project/github/koron-go/dialsrv/master.svg)](https://circleci.com/gh/koron-go/dialsrv/tree/master) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/koron-go/dialsrv)](https://pkg.go.dev/github.com/koron-go/dialsrv) +[![Actions/Go](https://github.com/koron-go/dialsrv/workflows/Go/badge.svg)](https://github.com/koron-go/dialsrv/actions?query=workflow%3AGo) [![Go Report Card](https://goreportcard.com/badge/github.com/koron-go/dialsrv)](https://goreportcard.com/report/github.com/koron-go/dialsrv) Dialer with SRV lookup. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bf1b7da --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/koron-go/dialsrv + +go 1.21 diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 0000000..8b70bd6 --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1,5 @@ +# vim:set ft=toml: + +checks = ["all"] + +# based on: github.com/koron-go/_skeleton/staticcheck.conf