Skip to content

Commit

Permalink
explicit comment for funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasticrabbit committed Nov 10, 2021
1 parent ea9b360 commit 9a6b486
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"golang.org/x/oauth2"
)

// accepts a client ID, client secret, and localhost port, and implements
// GetToken retrieves client ID, client secret, and localhost port, and implements
// webserver to allow end-user to authenticate, returning authorization token
func GetToken() (string, error) {
// Check for required config keys:
Expand Down
8 changes: 7 additions & 1 deletion internal/gettask.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TaskRequest struct {
Subtasks bool
}

//Builds the API path for a Clickup task request
//BuildPath creates the API path for a task request
func (t TaskRequest) BuildPath() string {
if !t.CustomTask {
return fmt.Sprintf("https://api.clickup.com/api/v2/task/%s/?include_subtasks=%t",
Expand All @@ -26,6 +26,7 @@ func (t TaskRequest) BuildPath() string {
}
}

//WriteOut reads the fileout Flag and writes to StdOut or file
func (t TaskRequest) WriteOut(payload []byte) {
if !viper.GetBool("file") {
fmt.Println(string(payload))
Expand All @@ -35,3 +36,8 @@ func (t TaskRequest) WriteOut(payload []byte) {
log.Fatalln("Error writing task JSON")
}
}

//GetJSON accepts an API path and returns byte payload of JSON data
func (t TaskRequest) GetJSON(apiPath string) []byte {
return getJSON(apiPath)
}

0 comments on commit 9a6b486

Please sign in to comment.