This commit is contained in:
William Banfield
2022-10-25 10:09:02 -04:00
parent 241be64da5
commit 4fbfea79ad
4 changed files with 7 additions and 9 deletions

View File

@@ -271,7 +271,7 @@ format:
lint:
@echo "--> Running linter"
@golangci-lint run
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run
.PHONY: lint
DESTINATION = ./index.html.md

View File

@@ -24,7 +24,7 @@ func (p *Provider) Setup() error {
if err != nil {
return err
}
// nolint: gosec
//nolint: gosec
// G306: Expect WriteFile permissions to be 0600 or less
err = os.WriteFile(filepath.Join(p.Testnet.Dir, "docker-compose.yml"), compose, 0644)
if err != nil {

View File

@@ -15,6 +15,6 @@ type Provider interface {
type NoopProvider struct {
}
func (_ NoopProvider) Setup() error { return nil }
func (NoopProvider) Setup() error { return nil }
var _ Provider = NoopProvider{}

View File

@@ -12,7 +12,6 @@ const (
dockerIPv6CIDR = "fd80:b10c::/48"
globalIPv4CIDR = "0.0.0.0/0"
globalIPv6CIDR = "0:0::/0"
)
// InfrastructureData contains the relevant information for a set of existing
@@ -56,11 +55,7 @@ func NewDockerInfrastructureData(m Manifest) (InfrastructureData, error) {
Instances: make(map[string]InstanceData),
Network: netAddress,
}
// gosec complains about the following line, stating that the second
// param in the range expression should be _- i.e. k, _ := range... -
// however, there is no second param in the range here so this seems
// like a false positive.
for name := range m.Nodes { //nolint: gosec
for name := range m.Nodes {
ifd.Instances[name] = InstanceData{
IPAddress: ipGen.Next(),
}
@@ -71,6 +66,9 @@ func NewDockerInfrastructureData(m Manifest) (InfrastructureData, error) {
func InfrastructureDataFromFile(p string) (InfrastructureData, error) {
ifd := InfrastructureData{}
b, err := os.ReadFile(p)
if err != nil {
return InfrastructureData{}, err
}
err = json.Unmarshal(b, &ifd)
if err != nil {
return InfrastructureData{}, err