Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Loading the config file into a string #2

@carstenhag

Description

@carstenhag

The Documentation ommits how to load the yaml/json file into a string,

Here's how I did it:

    file, readErr := ioutil.ReadFile("config.yaml")
    if readErr != nil {
        fmt.Println("Could not read config.yaml:", readErr)
        // Maybe exit the program?
    }
    yamlConfig := string(file)
        // parse the file etc

This would be useful to include in the docs. Also putting some of the documentation's example code into the README.md would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions