refactor: use type-specific functions for writing contents to a file
This commit is contained in:
@@ -295,9 +295,9 @@ func writeVectorConfig() error {
|
||||
b = bytes.Replace(b, []byte("\\u002B"), []byte("+"), -1)
|
||||
|
||||
vectorConfig := filepath.Join(common.GetDataDirectory("logs"), "vector.json")
|
||||
if err := common.WriteSliceToFile(common.WriteSliceToFileInput{
|
||||
if err := common.WriteBytesToFile(common.WriteBytesToFileInput{
|
||||
Bytes: b,
|
||||
Filename: vectorConfig,
|
||||
Lines: []string{string(b)},
|
||||
Mode: os.FileMode(0600),
|
||||
}); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user