mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-15 09:11:45 +01:00
Reformat with gofumpt
This commit is contained in:
@@ -561,7 +561,6 @@ func (r *NodeRepository) GetNodesForList(
|
||||
nodeFilter string,
|
||||
page *model.PageRequest,
|
||||
) ([]string, map[string]string, int, bool, error) {
|
||||
|
||||
// Init Return Vars
|
||||
nodes := make([]string, 0)
|
||||
stateMap := make(map[string]string)
|
||||
|
||||
@@ -188,7 +188,7 @@ func (fsa *FsArchive) Init(rawConfig json.RawMessage) (uint64, error) {
|
||||
if isEmpty {
|
||||
cclog.Infof("fsBackend Init() > Bootstrapping new archive at %s", fsa.path)
|
||||
versionStr := fmt.Sprintf("%d\n", Version)
|
||||
if err := os.WriteFile(filepath.Join(fsa.path, "version.txt"), []byte(versionStr), 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(fsa.path, "version.txt"), []byte(versionStr), 0o644); err != nil {
|
||||
cclog.Errorf("fsBackend Init() > failed to create version.txt: %v", err)
|
||||
return 0, err
|
||||
}
|
||||
@@ -674,7 +674,7 @@ func (fsa *FsArchive) ImportJob(
|
||||
|
||||
func (fsa *FsArchive) StoreClusterCfg(name string, config *schema.Cluster) error {
|
||||
dir := filepath.Join(fsa.path, name)
|
||||
if err := os.MkdirAll(dir, 0777); err != nil {
|
||||
if err := os.MkdirAll(dir, 0o777); err != nil {
|
||||
cclog.Errorf("StoreClusterCfg() > mkdir error: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ func countJobsNative(archivePath string) (int, error) {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("failed to walk directory: %w", err)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ func main() {
|
||||
|
||||
// Run migration
|
||||
migrated, failed, err := migrateArchive(archivePath, dryRun, numWorkers)
|
||||
|
||||
if err != nil {
|
||||
cclog.Errorf("Migration completed with errors: %s", err.Error())
|
||||
if failed > 0 {
|
||||
@@ -104,5 +103,5 @@ func checkVersion(archivePath string) error {
|
||||
|
||||
func updateVersion(archivePath string) error {
|
||||
versionFile := filepath.Join(archivePath, "version.txt")
|
||||
return os.WriteFile(versionFile, []byte("3\n"), 0644)
|
||||
return os.WriteFile(versionFile, []byte("3\n"), 0o644)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user