Skip to content

Commit

Permalink
feat: gomod v5 to v6 & upgrade golang to 1.21 (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 committed Jan 11, 2024
1 parent f6bc8b4 commit 7c69aa1
Show file tree
Hide file tree
Showing 31 changed files with 56 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build stage
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder

WORKDIR /app
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ddns-go

[![GitHub release](https://img.shields.io/github/release/jeessy2/ddns-go.svg?logo=github&style=flat-square) ![GitHub release downloads](https://img.shields.io/github/downloads/jeessy2/ddns-go/total?logo=github)](https://github.com/jeessy2/ddns-go/releases/latest) [![Go version](https://img.shields.io/github/go-mod/go-version/jeessy2/ddns-go)](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [![](https://goreportcard.com/badge/github.com/jeessy2/ddns-go/v5)](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v5) [![](https://img.shields.io/docker/image-size/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) [![](https://img.shields.io/docker/pulls/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go)
[![GitHub release](https://img.shields.io/github/release/jeessy2/ddns-go.svg?logo=github&style=flat-square) ![GitHub release downloads](https://img.shields.io/github/downloads/jeessy2/ddns-go/total?logo=github)](https://github.com/jeessy2/ddns-go/releases/latest) [![Go version](https://img.shields.io/github/go-mod/go-version/jeessy2/ddns-go)](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [![](https://goreportcard.com/badge/github.com/jeessy2/ddns-go/v6)](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v6) [![](https://img.shields.io/docker/image-size/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) [![](https://img.shields.io/docker/pulls/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go)

中文 | [English](https://github.com/jeessy2/ddns-go/blob/master/README_EN.md)

Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ddns-go

[![GitHub release](https://img.shields.io/github/release/jeessy2/ddns-go.svg?logo=github&style=flat-square) ![GitHub release downloads](https://img.shields.io/github/downloads/jeessy2/ddns-go/total?logo=github)](https://github.com/jeessy2/ddns-go/releases/latest) [![Go version](https://img.shields.io/github/go-mod/go-version/jeessy2/ddns-go)](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [![](https://goreportcard.com/badge/github.com/jeessy2/ddns-go/v5)](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v5) [![](https://img.shields.io/docker/image-size/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) [![](https://img.shields.io/docker/pulls/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go)
[![GitHub release](https://img.shields.io/github/release/jeessy2/ddns-go.svg?logo=github&style=flat-square) ![GitHub release downloads](https://img.shields.io/github/downloads/jeessy2/ddns-go/total?logo=github)](https://github.com/jeessy2/ddns-go/releases/latest) [![Go version](https://img.shields.io/github/go-mod/go-version/jeessy2/ddns-go)](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [![](https://goreportcard.com/badge/github.com/jeessy2/ddns-go/v6)](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v6) [![](https://img.shields.io/docker/image-size/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) [![](https://img.shields.io/docker/pulls/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go)

[中文](https://github.com/jeessy2/ddns-go/blob/master/README.md) | English

Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"sync"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
"gopkg.in/yaml.v3"
)

Expand Down
2 changes: 1 addition & 1 deletion config/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/url"
"strings"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
"golang.org/x/net/publicsuffix"
)

Expand Down
2 changes: 1 addition & 1 deletion config/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"strings"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
)

// Webhook Webhook
Expand Down
4 changes: 2 additions & 2 deletions dns/alidns.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"net/url"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/baidu.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"strconv"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

// https://cloud.baidu.com/doc/BCD/s/4jwvymhs7
Expand Down
4 changes: 2 additions & 2 deletions dns/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/url"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

type Callback struct {
Expand Down
4 changes: 2 additions & 2 deletions dns/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"strconv"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/dnspod.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package dns
import (
"net/url"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/godaddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"strconv"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

type godaddyRecord struct {
Expand Down
4 changes: 2 additions & 2 deletions dns/google_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/url"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/huawei.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"strconv"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions dns/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package dns
import (
"time"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/dns/internal"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/dns/internal"
"github.com/jeessy2/ddns-go/v6/util"
)

// DNS interface
Expand Down
2 changes: 1 addition & 1 deletion dns/internal/wait_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"time"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
)

// waitForNetworkConnected 等待网络连接后继续
Expand Down
4 changes: 2 additions & 2 deletions dns/namecheap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/namesilo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/porkbun.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dns/tencent_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"strconv"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jeessy2/ddns-go/v5
module github.com/jeessy2/ddns-go/v6

go 1.20
go 1.21

require (
github.com/kardianos/service v1.2.2
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
"strings"
"time"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/dns"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v5/util/update"
"github.com/jeessy2/ddns-go/v5/web"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/dns"
"github.com/jeessy2/ddns-go/v6/util"
"github.com/jeessy2/ddns-go/v6/util/update"
"github.com/jeessy2/ddns-go/v6/web"
"github.com/kardianos/service"
)

Expand Down
2 changes: 1 addition & 1 deletion util/update/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"runtime"
"strings"

"github.com/jeessy2/ddns-go/v5/util/semver"
"github.com/jeessy2/ddns-go/v6/util/semver"
)

// detectLatest 尝试从源提供者获取版本信息。
Expand Down
2 changes: 1 addition & 1 deletion util/update/latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package update

import "github.com/jeessy2/ddns-go/v5/util/semver"
import "github.com/jeessy2/ddns-go/v6/util/semver"

// Latest 表示当前操作系统和架构的最新 release asset。
type Latest struct {
Expand Down
4 changes: 2 additions & 2 deletions util/update/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"runtime"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v5/util/semver"
"github.com/jeessy2/ddns-go/v6/util"
"github.com/jeessy2/ddns-go/v6/util/semver"
)

// Self 更新 ddns-go 到最新版本(如果可用)。
Expand Down
2 changes: 1 addition & 1 deletion util/update/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package update
import (
"fmt"

"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
)

type Release struct {
Expand Down
4 changes: 2 additions & 2 deletions web/basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"time"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/util"
)

// ViewFunc func
Expand Down
2 changes: 1 addition & 1 deletion web/netInterfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v6/config"
)

// Ipv4NetInterfaces 获得Ipv4网卡信息
Expand Down
6 changes: 3 additions & 3 deletions web/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"
"time"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v5/dns"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/config"
"github.com/jeessy2/ddns-go/v6/dns"
"github.com/jeessy2/ddns-go/v6/util"
passwordvalidator "github.com/wagslane/go-password-validator"
)

Expand Down
5 changes: 3 additions & 2 deletions web/webhookTest.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package web

import (
"github.com/jeessy2/ddns-go/v5/util"
"net/http"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v6/util"

"github.com/jeessy2/ddns-go/v6/config"
)

// WebhookTest 测试webhook
Expand Down
2 changes: 1 addition & 1 deletion web/writing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"strings"

"github.com/jeessy2/ddns-go/v5/config"
"github.com/jeessy2/ddns-go/v6/config"
)

//go:embed writing.html
Expand Down

0 comments on commit 7c69aa1

Please sign in to comment.