refactor: move ptr package

This commit is contained in:
Fernandez Ludovic 2026-02-25 01:25:08 +01:00
commit e6d574f6ad
17 changed files with 17 additions and 20 deletions

View file

@ -150,8 +150,3 @@ func ParseIssueValue(value string) (IssueValue, error) {
return parsed, nil
}
// Pointer returns a pointer to v.
// TODO(ldez) factorize.
// TODO(ldez) it must be replaced with the builtin 'new' function when min Go 1.26.
func Pointer[T any](v T) *T { return &v }

View file

@ -9,4 +9,6 @@ func Deref[T any](v *T) T {
return *v
}
// Pointer returns a pointer to v.
// TODO(ldez) it must be replaced with the builtin 'new' function when min Go 1.26.
func Pointer[T any](v T) *T { return &v }

View file

@ -13,8 +13,8 @@ import (
alidns "github.com/go-acme/alidns-20150109/v4/client"
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"golang.org/x/net/idna"
)

View file

@ -13,8 +13,8 @@ import (
"github.com/aliyun/credentials-go/credentials"
esa "github.com/go-acme/esa-20240910/v2/client"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
)
// Environment variables names.

View file

@ -14,7 +14,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
)
var _ challenge.ProviderTimeout = (*DNSProviderPrivate)(nil)

View file

@ -14,7 +14,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns"
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
)
var _ challenge.ProviderTimeout = (*DNSProviderPublic)(nil)

View file

@ -9,7 +9,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
)
type ServiceDiscoveryZone struct {

View file

@ -9,8 +9,8 @@ import (
baidudns "github.com/baidubce/bce-sdk-go/services/dns"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
)
// Environment variables names.

View file

@ -11,10 +11,10 @@ import (
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/internal/useragent"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/clientdebug"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/nrdcg/bunny-go"
"golang.org/x/net/publicsuffix"
)

View file

@ -3,8 +3,8 @@ package bunny
import (
"testing"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/tester"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/nrdcg/bunny-go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View file

@ -10,8 +10,8 @@ import (
"time"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
teo "github.com/go-acme/tencentedgdeone/v20220901"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"

View file

@ -5,7 +5,7 @@ import (
"fmt"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
teo "github.com/go-acme/tencentedgdeone/v20220901"
)

View file

@ -13,10 +13,10 @@ import (
"github.com/cenkalti/backoff/v5"
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/platform/wait"
"github.com/go-acme/lego/v5/providers/dns/huaweicloud/internal"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
hwauthbasic "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
hwconfig "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/config"
hwdns "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dns/v2"

View file

@ -6,7 +6,7 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
awsconfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/lightsail"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/stretchr/testify/require"
)

View file

@ -20,9 +20,9 @@ import (
"github.com/cenkalti/backoff/v5"
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/platform/wait"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
)
// Environment variables names.

View file

@ -6,7 +6,7 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
awsconfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/route53"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/stretchr/testify/require"
)

View file

@ -11,8 +11,8 @@ import (
"github.com/go-acme/lego/v5/challenge"
"github.com/go-acme/lego/v5/challenge/dns01"
"github.com/go-acme/lego/v5/internal/ptr"
"github.com/go-acme/lego/v5/platform/config/env"
"github.com/go-acme/lego/v5/providers/dns/internal/ptr"
"github.com/volcengine/volc-sdk-golang/base"
volc "github.com/volcengine/volc-sdk-golang/service/dns"
)