I have a config file that contains lots of information but at the end it contains multiple key value pairs. Actually in the form of
item=a
item=b
item=c
I am trying to find the best way of removing these key value pairs using go, does anyone have a good example.
I looked into it and i found i could read a file and output it to another but wasn't sure if i could do it to the same file.
I also notice that you can open the for for append which could serve what I need.
The process would be - remove all key value pairs as explained above
and afterwards I need to add a new list of key value pairs
For example I could append to the file like so
f, err := os.OpenFile("myconfig.conf", os.O_APPEND|os.O_WRONLY,
This would allow me to push new items (append) to the file but I don't think this solves removing the items in the first place.