Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve yaml snippets in godoc #277

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ commands:

godoc:
desc: Starting GoDoc server on http://0.0.0.0:6060
run: (sleep 1; open http://0.0.0.0:6060)& godoc -http=:6060
run: (sleep 1; open http://0.0.0.0:6060/pkg/github.com/devbuddy/devbuddy/pkg/)& godoc -http=:6060

install-dev:
desc: Install bud in the GOROOT
Expand Down
18 changes: 9 additions & 9 deletions pkg/tasks/taskapi/task_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewTaskConfig(definition interface{}) (*TaskConfig, error) {
// GetListOfStrings expects the payload to be a list of string, returns it.
//
// YAML Example:
// - taskname:
// - TASKNAME:
// - foo
// - bar
func (c *TaskConfig) GetListOfStrings() ([]string, error) {
Expand All @@ -56,7 +56,7 @@ func (c *TaskConfig) GetListOfStrings() ([]string, error) {
// Or returns the default value specified if the payload is nil.
//
// YAML Example:
// - taskname:
// - TASKNAME:
// - foo
// - bar
func (c *TaskConfig) GetListOfStringsPropertyDefault(name string, defaultValue []string) ([]string, error) {
Expand All @@ -72,10 +72,10 @@ func (c *TaskConfig) GetListOfStringsPropertyDefault(name string, defaultValue [
// 2. the payload is a hash of string, returns the value for the name specified
//
// YAML Example:
// - taskname: foo
// - TASKNAME: foo
// or
// - taskname:
// <name>: foo
// - TASKNAME:
// PROPERTYNAME: foo
func (c *TaskConfig) GetStringPropertyAllowSingle(name string) (string, error) {
if value, ok := c.payload.(string); ok {
return value, nil
Expand All @@ -86,8 +86,8 @@ func (c *TaskConfig) GetStringPropertyAllowSingle(name string) (string, error) {
// GetStringProperty expects the payload to be a hash of string, returns the value for the name specified.
//
// YAML Example:
// - taskname:
// <name>: foo
// - TASKNAME:
// PROPERTYNAME: foo
func (c *TaskConfig) GetStringProperty(name string) (string, error) {
value, err := c.getProperty(name)
if err != nil {
Expand All @@ -100,8 +100,8 @@ func (c *TaskConfig) GetStringProperty(name string) (string, error) {
// Or returns the default value specified if the payload is nil.
//
// YAML Example:
// - taskname:
// <name>: foo
// - TASKNAME:
// PROPERTYNAME: foo
func (c *TaskConfig) GetStringPropertyDefault(name string, defaultValue string) (string, error) {
value, err := c.getPropertyDefault(name, defaultValue)
if err != nil {
Expand Down