Skip to content

Commit deeef50

Browse files
committed
Update golangci-lint and fix issues
1 parent a2a901f commit deeef50

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

.github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: golangci-lint
2121
uses: golangci/[email protected]
2222
with:
23-
version: v1.45
23+
version: v1.49

filesystem.go

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"net/http"
87
"os"
@@ -31,8 +30,6 @@ import (
3130
"github.com/pyrra-dev/pyrra/slo"
3231
)
3332

34-
var errEndpointNotImplemented = errors.New("endpoint not implement")
35-
3633
type Objectives struct {
3734
mu sync.RWMutex
3835
objectives map[string]slo.Objective

kubernetes_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ package main
22

33
import (
44
"context"
5-
"github.com/bufbuild/connect-go"
6-
objectivesv1alpha1 "github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1"
7-
"google.golang.org/protobuf/types/known/durationpb"
85
"testing"
96
"time"
107

8+
"github.com/bufbuild/connect-go"
119
"github.com/prometheus/prometheus/model/labels"
1210
"github.com/stretchr/testify/require"
11+
"google.golang.org/protobuf/types/known/durationpb"
1312
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1413
"sigs.k8s.io/controller-runtime/pkg/client"
1514
"sigs.k8s.io/yaml"
1615

1716
pyrrav1alpha1 "github.com/pyrra-dev/pyrra/kubernetes/api/v1alpha1"
17+
objectivesv1alpha1 "github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1"
1818
)
1919

2020
var (

main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"embed"
66
"fmt"
77
"html/template"
8+
"io"
89
"io/fs"
9-
"io/ioutil"
1010
"math"
1111
"net/http"
1212
"net/url"
@@ -259,7 +259,7 @@ func (c *thanosClient) Do(ctx context.Context, r *http.Request) (*http.Response,
259259
if r.Body == nil {
260260
return c.client.Do(ctx, r)
261261
}
262-
body, err := ioutil.ReadAll(r.Body)
262+
body, err := io.ReadAll(r.Body)
263263
if err != nil {
264264
return nil, nil, fmt.Errorf("reading body: %w", err)
265265
}
@@ -292,7 +292,7 @@ func (c *thanosClient) Do(ctx context.Context, r *http.Request) (*http.Response,
292292
}
293293

294294
encoded := query.Encode()
295-
r.Body = ioutil.NopCloser(strings.NewReader(encoded))
295+
r.Body = io.NopCloser(strings.NewReader(encoded))
296296
return c.client.Do(ctx, r)
297297
}
298298

main_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package main
22

33
import (
4-
objectivesv1alpha1 "github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1"
5-
"google.golang.org/protobuf/types/known/durationpb"
64
"math"
75
"testing"
86
"time"
97

108
"github.com/prometheus/common/model"
119
"github.com/prometheus/prometheus/model/labels"
12-
"github.com/pyrra-dev/pyrra/slo"
1310
"github.com/stretchr/testify/require"
11+
"google.golang.org/protobuf/types/known/durationpb"
12+
13+
objectivesv1alpha1 "github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1"
14+
"github.com/pyrra-dev/pyrra/slo"
1415
)
1516

1617
func TestMatrixToValues(t *testing.T) {

0 commit comments

Comments
 (0)