2023-01-26 20:58:13 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
2023-01-28 20:43:07 +00:00
|
|
|
"os"
|
2023-01-26 20:58:13 +00:00
|
|
|
)
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
func fileRead(src string) string {
|
2023-01-26 20:58:13 +00:00
|
|
|
content, err := ioutil.ReadFile(src)
|
|
|
|
|
2023-01-28 20:43:07 +00:00
|
|
|
errorPanic(err)
|
2023-01-26 20:58:13 +00:00
|
|
|
|
|
|
|
return string(content)
|
|
|
|
}
|
2023-01-28 20:43:07 +00:00
|
|
|
|
|
|
|
func fileAddLine(input string, filepath string) {
|
|
|
|
file, err := os.OpenFile(filepath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
|
|
|
errorPanic(err)
|
|
|
|
|
|
|
|
_, err = file.WriteString(input + "\n")
|
|
|
|
errorPanic(err)
|
|
|
|
}
|