feat: gomod v5 to v6 & upgrade golang to 1.21 (#969)

This commit is contained in:
jeessy2
2024-01-11 16:25:14 +08:00
committed by GitHub
parent f6bc8b4819
commit 7c69aa1bf7
31 changed files with 56 additions and 55 deletions

View File

@ -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 . .

View File

@ -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)

View File

@ -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

View File

@ -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"
)

View File

@ -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"
)

View File

@ -7,7 +7,7 @@ import (
"net/url"
"strings"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
)
// Webhook Webhook

View File

@ -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 (

View File

@ -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

View File

@ -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 {

View File

@ -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 (

View File

@ -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 (

View File

@ -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 {

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -4,7 +4,7 @@ import (
"strings"
"time"
"github.com/jeessy2/ddns-go/v5/util"
"github.com/jeessy2/ddns-go/v6/util"
)
// waitForNetworkConnected 等待网络连接后继续

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

4
go.mod
View File

@ -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

10
main.go
View File

@ -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"
)

View File

@ -8,7 +8,7 @@ import (
"runtime"
"strings"
"github.com/jeessy2/ddns-go/v5/util/semver"
"github.com/jeessy2/ddns-go/v6/util/semver"
)
// detectLatest 尝试从源提供者获取版本信息。

View File

@ -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 {

View File

@ -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 到最新版本(如果可用)。

View File

@ -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 {

View File

@ -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

View File

@ -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网卡信息

View File

@ -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"
)

View File

@ -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

View File

@ -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