Repository: prometheus/prometheus
File: util/fmtutil/format_test.go (Go)

Code before:
// Copyright 2023 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package fmtutil

import (
	"bytes"
	"math"
	"testing"
	"time"

	dto "github.com/prometheus/client_model/go"
	"github.com/prometheus/prometheus/prompb"
	"github.com/stretchr/testify/require"
)

var writeRequestFixture = &prompb.WriteRequest{
	Metadata: []prompb.MetricMetadata{
		{
			MetricFamilyName: "http_request_duration_seconds",
			Type:             3,
			Help:             "A histogram of the request duration.",
		},
		{
			MetricFamilyName: "http_requests_total",
			Type:             1,
			Help:             "The total number of HTTP requests.",
		},
		{
			MetricFamilyName: "rpc_duration_seconds",
			Type:             5,
			Help:             "A summary of the RPC duration in seconds.",
		},
		{
			MetricFamilyName: "test_metric1",
			Type:             2,
			Help:             "This is a test metric.",
		},

Review comment (suggestion):
prompb is a "local" package, goimports is run with :
```
goimports -w -local github.com/prometheus/prometheus util/fmtutil/format_test.go 
```

```suggestion
	dto "github.com/prometheus/client_model/go"
	"github.com/stretchr/testify/require"
	
	"github.com/prometheus/prometheus/prompb"
```

Code after:
// Copyright 2023 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package fmtutil

import (
	"bytes"
	"math"
	"testing"
	"time"

	dto "github.com/prometheus/client_model/go"
	"github.com/stretchr/testify/require"

	"github.com/prometheus/prometheus/prompb"
)

var writeRequestFixture = &prompb.WriteRequest{
	Metadata: []prompb.MetricMetadata{
		{
			MetricFamilyName: "http_request_duration_seconds",
			Type:             3,
			Help:             "A histogram of the request duration.",
		},
		{
			MetricFamilyName: "http_requests_total",
			Type:             1,
			Help:             "The total number of HTTP requests.",
		},
		{
			MetricFamilyName: "rpc_duration_seconds",
			Type:             5,
			Help:             "A summary of the RPC duration in seconds.",
		},
		{
			MetricFamilyName: "test_metric1",
			Type:             2,
			Help:             "This is a test metric.",