-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78f7aaf
commit d646017
Showing
5 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package input | ||
|
||
import ( | ||
"os" | ||
"gopkg.in/yaml.v3" | ||
) | ||
|
||
type Params struct { | ||
Info struct { | ||
Name string `yaml:"name"` | ||
FirstName string `yaml:"firstname"` | ||
Number string `yaml:"number"` | ||
Mail string `yaml:"mail"` | ||
GitHub string `yaml:"github"` | ||
LinkedIn string `yaml:"linkedin"` | ||
} `yaml:"info"` | ||
Variante map[string][]string `yaml:"variante"` | ||
} | ||
|
||
type YamlSource struct{} | ||
|
||
func (*YamlSource) GetParamsFrom(root string) (Params, error) { | ||
params := Params{} | ||
yamlFile, err := os.ReadFile(root + "/params.yml") | ||
if err != nil { | ||
return params, err | ||
} | ||
err = yaml.Unmarshal(yamlFile, ¶ms) | ||
if err != nil { | ||
return params, err | ||
} | ||
return params, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters