Skip to content

Commit 23b7969

Browse files
committed
fix: resolve staticcheck issues for pg tune
1 parent a390b25 commit 23b7969

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

cli/postgres/autoconf.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ func WriteAutoConf(path, dbsu string, params map[string]string, headerComment st
5858
// Read existing content. If file is missing, initialize from scratch.
5959
// If existing file exists but read fails, abort instead of clobbering it.
6060
content, readErr := utils.ReadFileAsDBSU(path, dbsu)
61-
existingLines := []string{}
61+
var existingLines []string
6262
if readErr != nil {
6363
if _, statErr := os.Stat(path); statErr != nil {
64-
if os.IsNotExist(statErr) {
65-
existingLines = []string{}
66-
} else {
64+
if !os.IsNotExist(statErr) {
6765
return fmt.Errorf("cannot access existing file %s: %w", path, statErr)
6866
}
6967
} else {

cli/postgres/tune_result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TuneResult(cfg *Config, opts *TuneOptions) *output.Result {
8080
data := &TuneResultData{
8181
Profile: prof.Name,
8282
PgVersion: pgVersion,
83-
Hardware: TuneHardwareInfo{CPU: spec.CPU, MemMB: spec.MemMB, DiskGB: spec.DiskGB},
83+
Hardware: TuneHardwareInfo(spec),
8484
Params: make(map[string]string, len(params)),
8585
}
8686
for _, p := range params {

0 commit comments

Comments
 (0)