Skip to content

Commit

Permalink
fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lovromazgon committed Nov 4, 2024
1 parent c2905c2 commit 1aa3bae
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions example/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright © 2024 Meroxa, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
Expand Down Expand Up @@ -41,6 +55,7 @@ func (c *RootCommand) Flags() []ecdysis.Flag {
flags.SetDefault("viper", true)
return flags
}

func (c *RootCommand) Docs() ecdysis.Docs {
return ecdysis.Docs{
Short: "An example CLI for ecdysis based Applications",
Expand All @@ -50,6 +65,7 @@ a wrapper around Cobra that allows you to declare
commands as Go types.`,
}
}

func (c *RootCommand) SubCommands() []ecdysis.Command {
return []ecdysis.Command{
// inject root flags in sub-command
Expand All @@ -60,13 +76,9 @@ func (c *RootCommand) SubCommands() []ecdysis.Command {

type AddCommand struct {
rootFlags *RootFlags
flags struct {
}
}

var (
_ ecdysis.CommandWithExecute = (*AddCommand)(nil)
)
var _ ecdysis.CommandWithExecute = (*AddCommand)(nil)

func (c *AddCommand) Usage() string { return "add" }
func (c *AddCommand) Execute(context.Context) error {
Expand All @@ -87,6 +99,7 @@ func (c *VersionCommand) Docs() ecdysis.Docs {
Short: "Print the version number of example-cli",
}
}

func (c *VersionCommand) Execute(context.Context) error {
fmt.Println("example-cli v0.1.0")
return nil
Expand Down

0 comments on commit 1aa3bae

Please sign in to comment.