added comment and remnamed stuff etc

This commit is contained in:
2024-02-15 14:14:40 +01:00
parent 191b110846
commit a3d894cfb5
4 changed files with 9 additions and 11 deletions

3
.gitignore vendored
View File

@@ -1 +1,2 @@
.env
.env
data.json

3
data.json.example Normal file
View File

@@ -0,0 +1,3 @@
{
"tags": {}
}

View File

@@ -6,6 +6,8 @@ import (
"os"
)
//DATA WILL ONLY BE USED AS JSON FILE FOR TESTING. SYSTEM WILL BE REPLACED
type Tags struct {
Tags map[string]string `json:"tags"`
}
@@ -54,7 +56,7 @@ func modifyTag(tags *Tags, tagKey string, newTagValue string) {
}
func debugTags() {
tags, err := readTags("tags.json")
tags, err := readTags("data.json")
if err != nil {
log.Fatalf("Failed to read tags: %v", err)
}
@@ -63,7 +65,7 @@ func debugTags() {
removeTag(tags, "test_command")
modifyTag(tags, "another_test_command", "updated command description")
err = writeTags("tags.json", tags)
err = writeTags("data.json", tags)
if err != nil {
log.Fatalf("Failed to write tags: %v", err)
}

View File

@@ -1,8 +0,0 @@
{
"tags": {
"another_another_test_command": "updated command description",
"another_test_command": "updated command description",
"new_command": "a new command description",
"new_tag": "A newly added tag."
}
}