forked from LaconicNetwork/kompose
fix golint errors
This commit is contained in:
@@ -31,6 +31,7 @@ import (
|
||||
"github.com/kubernetes-incubator/kompose/pkg/kobject"
|
||||
)
|
||||
|
||||
// Bundle is docker bundle file loader, implements Loader interface
|
||||
type Bundle struct {
|
||||
}
|
||||
|
||||
@@ -172,7 +173,7 @@ func loadPorts(service Service) ([]kobject.Ports, string) {
|
||||
return ports, ""
|
||||
}
|
||||
|
||||
// load dab file into KomposeObject
|
||||
// LoadFile loads dab file into KomposeObject
|
||||
func (b *Bundle) LoadFile(files []string) kobject.KomposeObject {
|
||||
komposeObject := kobject.KomposeObject{
|
||||
ServiceConfigs: make(map[string]kobject.ServiceConfig),
|
||||
@@ -244,7 +245,7 @@ func loadFile(reader io.Reader) (*Bundlefile, error) {
|
||||
jsonErr.Error())
|
||||
case *json.UnmarshalTypeError:
|
||||
return nil, fmt.Errorf(
|
||||
"Unexpected type at byte %v. Expected %s but received %s.",
|
||||
"unexpected type at byte %v. expected %s but received %s",
|
||||
jsonErr.Offset,
|
||||
jsonErr.Type,
|
||||
jsonErr.Value)
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
"github.com/kubernetes-incubator/kompose/pkg/kobject"
|
||||
)
|
||||
|
||||
// Compose is docker compose file loader, implements Loader interface
|
||||
type Compose struct {
|
||||
}
|
||||
|
||||
@@ -220,7 +221,7 @@ func loadPorts(composePorts []string) ([]kobject.Ports, error) {
|
||||
return ports, nil
|
||||
}
|
||||
|
||||
// load compose file into KomposeObject
|
||||
// LoadFile loads compose file into KomposeObject
|
||||
func (c *Compose) LoadFile(files []string) kobject.KomposeObject {
|
||||
komposeObject := kobject.KomposeObject{
|
||||
ServiceConfigs: make(map[string]kobject.ServiceConfig),
|
||||
|
||||
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package loader
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/kubernetes-incubator/kompose/pkg/kobject"
|
||||
@@ -25,6 +24,7 @@ import (
|
||||
"github.com/kubernetes-incubator/kompose/pkg/loader/compose"
|
||||
)
|
||||
|
||||
// Loader interface defines loader that loads files and converts it to kobject representation
|
||||
type Loader interface {
|
||||
LoadFile(files []string) kobject.KomposeObject
|
||||
///Name() string
|
||||
@@ -40,7 +40,7 @@ func GetLoader(format string) (Loader, error) {
|
||||
case "compose":
|
||||
l = new(compose.Compose)
|
||||
default:
|
||||
return nil, errors.New(fmt.Sprintf("Input file format %s is not supported", format))
|
||||
return nil, fmt.Errorf("Input file format %s is not supported", format)
|
||||
}
|
||||
|
||||
return l, nil
|
||||
|
||||
Reference in New Issue
Block a user