detached becc750

refactor: Remove unused isWSL function from configuration initialization

- Deleted the isWSL function that checked for WSL environment, including related logging.
- Streamlined the init_config.go file by eliminating unnecessary code.
commit
becc750bc918e29b63e5f701ea5b6d0bb328deb0
author
bamen · · 2025-03-29 08:58 UTC
parent
3ac0ad3
signature
unsigned
1 file · +0 -24
M internal/common/init_config.go +0 -24
@@ -756,30 +756,6 @@ func (c *Config) GetToken() string {
756756 return c.General.JwtToken
757757 }
758758
759-func isWSL() bool {
760- logger.Debug("isWSL: Checking if running in WSL")
761- // Check if /proc/version exists
762- _, err := os.Stat("/proc/version")
763- if err != nil {
764- logger.Debug("isWSL: /proc/version does not exist, not WSL", "error", err)
765- return false
766- }
767-
768- // Read /proc/version file
769- logger.Debug("isWSL: Reading /proc/version file")
770- data, err := os.ReadFile("/proc/version")
771- if err != nil {
772- logger.Debug("isWSL: Failed to read /proc/version", "error", err)
773- return false
774- }
775-
776- // Convert to string and check if it contains "Microsoft" or "WSL"
777- version := string(data)
778- isWsl := strings.Contains(strings.ToLower(version), "microsoft") || strings.Contains(strings.ToLower(version), "wsl")
779- logger.Debug("isWSL: WSL detection result", "isWsl", isWsl)
780- return isWsl
781-}
782-
783759 func (c *HttpConfig) Protocol() string {
784760 if c.Https {
785761 return "https"
@@ -756,30 +756,6 @@ func (c *Config) GetToken() string {
756 return c.General.JwtToken756 return c.General.JwtToken
757 }757 }
758 758
759-func isWSL() bool {
760- logger.Debug("isWSL: Checking if running in WSL")
761- // Check if /proc/version exists
762- _, err := os.Stat("/proc/version")
763- if err != nil {
764- logger.Debug("isWSL: /proc/version does not exist, not WSL", "error", err)
765- return false
766- }
767-
768- // Read /proc/version file
769- logger.Debug("isWSL: Reading /proc/version file")
770- data, err := os.ReadFile("/proc/version")
771- if err != nil {
772- logger.Debug("isWSL: Failed to read /proc/version", "error", err)
773- return false
774- }
775-
776- // Convert to string and check if it contains "Microsoft" or "WSL"
777- version := string(data)
778- isWsl := strings.Contains(strings.ToLower(version), "microsoft") || strings.Contains(strings.ToLower(version), "wsl")
779- logger.Debug("isWSL: WSL detection result", "isWsl", isWsl)
780- return isWsl
781-}
782-
783 func (c *HttpConfig) Protocol() string {759 func (c *HttpConfig) Protocol() string {
784 if c.Https {760 if c.Https {
785 return "https"761 return "https"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close