added comment and remnamed stuff etc
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
.env
|
.env
|
||||||
|
data.json
|
3
data.json.example
Normal file
3
data.json.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tags": {}
|
||||||
|
}
|
@@ -6,6 +6,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//DATA WILL ONLY BE USED AS JSON FILE FOR TESTING. SYSTEM WILL BE REPLACED
|
||||||
|
|
||||||
type Tags struct {
|
type Tags struct {
|
||||||
Tags map[string]string `json:"tags"`
|
Tags map[string]string `json:"tags"`
|
||||||
}
|
}
|
||||||
@@ -54,7 +56,7 @@ func modifyTag(tags *Tags, tagKey string, newTagValue string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func debugTags() {
|
func debugTags() {
|
||||||
tags, err := readTags("tags.json")
|
tags, err := readTags("data.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to read tags: %v", err)
|
log.Fatalf("Failed to read tags: %v", err)
|
||||||
}
|
}
|
||||||
@@ -63,7 +65,7 @@ func debugTags() {
|
|||||||
removeTag(tags, "test_command")
|
removeTag(tags, "test_command")
|
||||||
modifyTag(tags, "another_test_command", "updated command description")
|
modifyTag(tags, "another_test_command", "updated command description")
|
||||||
|
|
||||||
err = writeTags("tags.json", tags)
|
err = writeTags("data.json", tags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to write tags: %v", err)
|
log.Fatalf("Failed to write tags: %v", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user