@@ -129,7 +129,7 @@ func UpdateOrRemoveKeyValue(envVar, key, newValue string, delete bool) error {
129129 return WriteLines (filePath , updatedLines )
130130}
131131
132- // Helper function to read lines from a file.
132+ // ReadLines reads lines from a file and returns them as a slice of strings .
133133func ReadLines (filename string ) ([]string , error ) {
134134 file , err := os .Open (filename )
135135 if err != nil {
@@ -145,7 +145,7 @@ func ReadLines(filename string) ([]string, error) {
145145 return lines , scanner .Err ()
146146}
147147
148- // Helper function to write lines to a file.
148+ // WriteLines writes a slice of strings to a file, each string being written to a new line .
149149func WriteLines (filename string , lines []string ) error {
150150 file , err := os .Create (filename )
151151 if err != nil {
@@ -162,7 +162,7 @@ func WriteLines(filename string, lines []string) error {
162162 return nil
163163}
164164
165- // Helper function to parse a line into key and value, considering file format .
165+ // ParseKeyValue parses a key-value pair from a string and returns the key and value .
166166func ParseKeyValue (line , ext string ) (string , string ) {
167167 if ext == ".env" {
168168 parts := strings .SplitN (line , "=" , 2 )
@@ -180,7 +180,7 @@ func ParseKeyValue(line, ext string) (string, string) {
180180 return "" , ""
181181}
182182
183- // Helper function to format a key-value pair as a line, considering file format .
183+ // FormatKeyValue formats a key-value pair into a string .
184184func FormatKeyValue (key , value , ext string ) string {
185185 if ext == ".env" {
186186 return fmt .Sprintf ("%s=%s" , key , value )
0 commit comments