This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push: new 42c1cfd chore(lint): fix findings 42c1cfd is described below commit 42c1cfd12fff25c7cb090ce100857e986a096263 Author: lburgazzoli <lburgazz...@gmail.com> AuthorDate: Mon May 20 13:45:17 2019 +0200 chore(lint): fix findings --- pkg/apis/camel/v1alpha1/integration_types_support_test.go | 1 + pkg/cmd/describe.go | 8 ++------ pkg/cmd/run.go | 2 +- pkg/trait/knative_service.go | 10 +++------- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pkg/apis/camel/v1alpha1/integration_types_support_test.go b/pkg/apis/camel/v1alpha1/integration_types_support_test.go index 48e6e26..c6a4c23 100644 --- a/pkg/apis/camel/v1alpha1/integration_types_support_test.go +++ b/pkg/apis/camel/v1alpha1/integration_types_support_test.go @@ -36,6 +36,7 @@ func TestAllLanguages(t *testing.T) { func TestLanguageFromName(t *testing.T) { for _, l := range Languages { + l := l t.Run(string(l), func(t *testing.T) { code := SourceSpec{ DataSpec: DataSpec{ diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go index c407f0f..95c59c6 100644 --- a/pkg/cmd/describe.go +++ b/pkg/cmd/describe.go @@ -51,10 +51,6 @@ func (iw *indentedWriter) write(indentLevel int, format string, i ...interface{} fmt.Fprintf(iw.out, prefix+format, i...) } -func (iw *indentedWriter) writeLine(i ...interface{}) { - fmt.Fprintln(iw.out, i...) -} - func (iw *indentedWriter) Flush() { if f, ok := iw.out.(flusher); ok { f.flush() @@ -104,8 +100,8 @@ func indentedString(f func(io.Writer)) string { f(out) out.Flush() - str := string(buf.String()) - return str + + return buf.String() } func newCmdDescribe(rootCmdOptions *RootCmdOptions) *cobra.Command { diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index a70fff7..9fb6e8a 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -149,7 +149,7 @@ func (o *runCmdOptions) validateArgs(_ *cobra.Command, args []string) error { for _, volume := range o.Volumes { volumeConfig := strings.Split(volume, ":") if len(volumeConfig) != 2 || len(strings.TrimSpace(volumeConfig[0])) == 0 || len(strings.TrimSpace(volumeConfig[1])) == 0 { - return fmt.Errorf("Volume '%s' is invalid. It should be in the format: pvcname:/container/path", volume) + return fmt.Errorf("volume '%s' is invalid, it should be in the format: pvcname:/container/path", volume) } } diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go index 4731353..bae73dd 100644 --- a/pkg/trait/knative_service.go +++ b/pkg/trait/knative_service.go @@ -110,11 +110,7 @@ func (t *knativeServiceTrait) Configure(e *Environment) (bool, error) { } func (t *knativeServiceTrait) Apply(e *Environment) error { - svc, err := t.getServiceFor(e) - if err != nil { - return err - } - + svc := t.getServiceFor(e) maps := e.ComputeConfigMaps() e.Resources.Add(svc) @@ -123,7 +119,7 @@ func (t *knativeServiceTrait) Apply(e *Environment) error { return nil } -func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, error) { +func (t *knativeServiceTrait) getServiceFor(e *Environment) *serving.Service { labels := map[string]string{ "camel.apache.org/integration": e.Integration.Name, } @@ -212,5 +208,5 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, e &svc.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.VolumeMounts, ) - return &svc, nil + return &svc }