refact: pkg/apiclient set and use default user agent (#3219)

* default user agent

* DRY default user agent

* useragent.go

* moved to pkg/apiclient/useragent

* lint

* rename useragent.DefaultUserAgent() -> useragent.Default()
This commit is contained in:
mmetc 2024-09-09 11:27:20 +02:00 committed by GitHub
parent 57dee1abf9
commit c8750f604c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 82 additions and 95 deletions

View file

@ -11,7 +11,6 @@ import (
"github.com/stretchr/testify/require"
"github.com/crowdsecurity/crowdsec/pkg/apiclient"
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
)
func TestAPICSendMetrics(t *testing.T) {
@ -70,7 +69,7 @@ func TestAPICSendMetrics(t *testing.T) {
apiClient, err := apiclient.NewDefaultClient(
url,
"/api",
cwversion.UserAgent(),
"",
nil,
)
require.NoError(t, err)