Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasPf committed Dec 23, 2019
1 parent 4ceccd3 commit 7ce2f6f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: lint
lint:
golangci-lint run --enable gofmt ./...

2 changes: 1 addition & 1 deletion pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (bm *BasicManager) createContainer(ctx context.Context, container Container
var mounts []mount.Mount
for _, mountParam := range container.Mounts {

from := mountParam.From
from := ""
if mountParam.Type == "bind" {
from = bm.addBasePath(mountParam.From)
} else { // volume
Expand Down
7 changes: 3 additions & 4 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
package node

import (
"strings"
"encoding/json"
"fmt"
"io/ioutil"
"path"
"os"
"path"
"path/filepath"
"strings"

"github.com/Blockdaemon/bpm-sdk/internal/util"
homedir "github.com/mitchellh/go-homedir"
Expand Down Expand Up @@ -119,7 +119,7 @@ func (c Node) Save() error {
}

func New(nodeFile string) Node {
return Node{ nodeFile: nodeFile }
return Node{nodeFile: nodeFile}
}

// Load all the data for a particular node and creates all required directories
Expand Down Expand Up @@ -185,4 +185,3 @@ func Load(nodeFile string) (Node, error) {

return node, nil
}

6 changes: 3 additions & 3 deletions pkg/plugin/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func (d DockerPlugin) ValidateParameters(currentNode node.Node) error {

if parameter.Type == ParameterTypeBool {
_, ok = currentNode.BoolParameters[parameter.Name]
}
}

if parameter.Type == ParameterTypeString {
_, ok = currentNode.StrParameters[parameter.Name]

}
}

if !ok {
return fmt.Errorf(`%q missing`, parameter.Name)
Expand All @@ -110,7 +110,7 @@ func (d DockerPlugin) CreateSecrets(currentNode node.Node) error {

// The default upgrade strategy removes all containers. If they where running they get started again which will pull new container images.
//
// This works as long as only the container version changes. If the the upgrade needs changes to the configs or migrations tasks it is
// This works as long as only the container version changes. If the the upgrade needs changes to the configs or migrations tasks it is
// recommended to overwrite this function
func (d DockerPlugin) Upgrade(currentNode node.Node) error {
status, err := d.Status(currentNode)
Expand Down
10 changes: 5 additions & 5 deletions pkg/plugin/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const (
ParameterTypeBool = "bool"
ParameterTypeString = "string"

SupportsTest = "test"
SupportsTest = "test"
)

type Parameter struct {
Expand All @@ -20,11 +20,11 @@ type Parameter struct {
}

type MetaInfo struct {
Version string
Description string
Version string
Description string
ProtocolVersion string `yaml:"protocol_version"`
Parameters []Parameter
Supported []string
Parameters []Parameter
Supported []string
}

func (p MetaInfo) String() string {
Expand Down

0 comments on commit 7ce2f6f

Please sign in to comment.