Skip to content

Instantly share code, notes, and snippets.

@carlisia
Created September 5, 2015 23:53
Show Gist options
  • Save carlisia/c7b791b13b2b98d0c08d to your computer and use it in GitHub Desktop.
Save carlisia/c7b791b13b2b98d0c08d to your computer and use it in GitHub Desktop.
cat commands/author.go
~/devgo/src/github.com/carlisia/gc6-carlisia
☻ cat commands/author.go ruby-2.2.0p0 master 109bbc4 ✗
// Copyright © 2015 Steve Francia <[email protected]>.
//
// 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 commands
import (
"fmt"
"github.com/spf13/cobra"
)
// Defining the author command.
// This will be called as 'labyrinth author'
// It uses a variable set in the labyrinth.go file
var authorCmd = &cobra.Command{
Use: "author",
Short: "Print the creator of this laybrinth",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("WE ARE THE HAMPIONS")
fmt.Println(AuthorName)
},
}
func init() {
fmt.Println("WE ARE THE HAMPIONS NO INITTTT")
RootCmd.AddCommand(authorCmd)
}
~/devgo/src/github.com/carlisia/gc6-carlisia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment