Skip to content

internal: remove redundant environment variable checks in ConfigDir#196

Merged
tklauser merged 1 commit into
masterfrom
configdir-windows
Jan 31, 2023
Merged

internal: remove redundant environment variable checks in ConfigDir#196
tklauser merged 1 commit into
masterfrom
configdir-windows

Conversation

@tklauser
Copy link
Copy Markdown
Contributor

@tklauser tklauser commented Jan 27, 2023

os.UserConfigDir will already check the AppData environment variable on
Windows (environment variable names are case-insensitive on Windows):
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=461-465
and the XDG_CONFIG_HOME environment variable on Unix operating systems:
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=481-489

@tklauser tklauser requested a review from odeke-em January 27, 2023 12:37
Comment thread internal/internal.go Outdated
os.UserConfigDir will already check the AppData environment variable on
Windows (environment variable names are case-insensitive on Windows):
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=461-465
and the XDG_CONFIG_HOME environment variable on Unix operating systems:
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=481-489
@tklauser tklauser changed the title internal: remove redundant check for AppData directory on windows internal: remove redundant environment variable checks in ConfigDir Jan 31, 2023
Copy link
Copy Markdown

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tklauser, LGTM!

@tklauser tklauser merged commit 52a0828 into master Jan 31, 2023
@tklauser tklauser deleted the configdir-windows branch January 31, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants