Skip to content

Commit 4246f9b

Browse files
committed
edit: work on linter warnings
Imports were formatted with linter. `result` variable assignment in `filterGuests` was changed.
1 parent 9cd614d commit 4246f9b

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

datasource/proxmox/data.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ import (
1010
"crypto/tls"
1111
"errors"
1212
"fmt"
13-
"github.com/Telmate/proxmox-api-go/proxmox"
14-
"github.com/hashicorp/hcl/v2/hcldec"
15-
"github.com/hashicorp/packer-plugin-sdk/common"
16-
"github.com/hashicorp/packer-plugin-sdk/hcl2helper"
17-
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
18-
"github.com/hashicorp/packer-plugin-sdk/template/config"
19-
"github.com/zclconf/go-cty/cty"
2013
"log"
2114
"net/url"
2215
"os"
2316
"regexp"
2417
"strconv"
2518
"strings"
2619
"time"
20+
21+
"github.com/Telmate/proxmox-api-go/proxmox"
22+
"github.com/hashicorp/hcl/v2/hcldec"
23+
"github.com/hashicorp/packer-plugin-sdk/common"
24+
"github.com/hashicorp/packer-plugin-sdk/hcl2helper"
25+
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
26+
"github.com/hashicorp/packer-plugin-sdk/template/config"
27+
"github.com/zclconf/go-cty/cty"
2728
)
2829

2930
// Datasource has a bunch of filters which you can use, for example, to find the latest available
@@ -243,7 +244,7 @@ func getVmConfigs(client *proxmox.Client, vmList []proxmox.GuestResource) ([]vmC
243244

244245
// Drop guests from list that are not match some filters in the datasource config.
245246
func filterGuests(config Config, guests []proxmox.GuestResource) []proxmox.GuestResource {
246-
result := make([]proxmox.GuestResource, 0)
247+
var result []proxmox.GuestResource
247248

248249
if config.Name != "" {
249250
result = filterByName(guests, config.Name)

datasource/proxmox/data_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package proxmoxtemplate
22

33
import (
44
"fmt"
5-
"github.com/Telmate/proxmox-api-go/proxmox"
6-
"github.com/stretchr/testify/require"
75
"net/http"
86
"net/http/httptest"
97
"net/url"
108
"testing"
9+
10+
"github.com/Telmate/proxmox-api-go/proxmox"
11+
"github.com/stretchr/testify/require"
1112
)
1213

1314
// For the sake of saving code clean have left only test-related fields in these JSONs.

0 commit comments

Comments
 (0)