Skip to content

Commit

Permalink
feat: Update the Golang version to 1.20 (#1)
Browse files Browse the repository at this point in the history
* feat: Update the Golang version to 1.20

* fix: The failing GH Actions
  • Loading branch information
ZPascal authored Jul 24, 2023
1 parent 0f27952 commit 27d90b2
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ^1.17
go-version: "1.20"

- name: Check out code
uses: actions/checkout@v3
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.6.0
uses: golangci/golangci-lint-action@v3
with:
version: v1.43
version: v1.53
args: --timeout 240s
20 changes: 15 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
depth: 0
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.17
go-version: "1.20"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
args: "release --clean"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/pull/')
with:
version: latest
args: "release --clean --snapshot"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ builds:
goos:
- linux
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- v0.10:
- Switched to go 1.20
- v0.9.1:
- Switched to codecov and publish docker images on github
- v0.9:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A simplified DNS server with a RESTful HTTP API to provide a simple way to autom
## Why?

Many DNS servers do not provide an API to enable automation for the ACME DNS challenges. Those which do, give the keys way too much power.
Leaving the keys laying around your random boxes is too often a requirement to have a meaningful process automation.
Leaving the keys lying around your random boxes is too often a requirement to have a meaningful process automation.

Acme-dns provides a simple API exclusively for TXT record updates and should be used with ACME magic "\_acme-challenge" - subdomain CNAME records. This way, in the unfortunate exposure of API keys, the effects are limited to the subdomain TXT record in question.

Expand Down Expand Up @@ -116,7 +116,7 @@ See the INSTALL section for information on how to do this.

## Installation

1. Install [Go 1.17 or newer](https://golang.org/doc/install).
1. Install [Go 1.20 or newer](https://golang.org/doc/install).
2. Build acme-dns:

```bash
Expand Down
7 changes: 3 additions & 4 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"

"github.com/julienschmidt/httprouter"
log "github.com/sirupsen/logrus"
"io"
"net/http"
)

// RegResponse is a struct for registration response JSON
Expand All @@ -24,7 +23,7 @@ func webRegisterPost(w http.ResponseWriter, r *http.Request, _ httprouter.Params
var reg []byte
var err error
aTXT := ACMETxt{}
bdata, _ := ioutil.ReadAll(r.Body)
bdata, _ := io.ReadAll(r.Body)
if len(bdata) > 0 {
err = json.Unmarshal(bdata, &aTXT)
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/joohoi/acme-dns

go 1.17
go 1.20

require (
github.com/BurntSushi/toml v1.3.2
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/caddyserver/certmagic v0.19.0
github.com/caddyserver/certmagic v0.19.1
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
github.com/gavv/httpexpect v2.0.0+incompatible
github.com/go-acme/lego/v3 v3.9.0
Expand Down Expand Up @@ -50,10 +50,10 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/tools v0.11.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 27d90b2

Please sign in to comment.