Validator client - Improve readability - NO FUNCTIONAL CHANGE (#13468)

* Improve `NewServiceRegistry` documentation.

* Improve `README.md`.

* Improve readability of `registerValidatorService`.

* Move `log` in `main.go`.

Since `log` is only used in `main.go`.

* Clean Tos.

* `DefaultDataDir`: Use `switch` instead of `if/elif`.

* `ReadPassword`: Remove unused receiver.

* `validator/main.go`: Clean.

* `WarnIfPlatformNotSupported`: Add Mac OSX ARM64.

* `runner.go`: Use idiomatic `err` handling.

* `waitForChainStart`: Avoid `chainStartResponse`mutation.

* `WaitForChainStart`: Reduce cognitive complexity.

* Logs: `powchain` ==> `execution`.
This commit is contained in:
Manu NALEPA
2024-01-15 15:46:54 +01:00
committed by GitHub
parent b585ff77f5
commit 99a8d0bac6
15 changed files with 150 additions and 109 deletions

View File

@@ -31,11 +31,12 @@ func DefaultDataDir() string {
// Try to place the data folder in the user's home dir
home := file.HomeDir()
if home != "" {
if runtime.GOOS == "darwin" {
switch runtime.GOOS {
case "darwin":
return filepath.Join(home, "Library", "Eth2")
} else if runtime.GOOS == "windows" {
case "windows":
return filepath.Join(home, "AppData", "Local", "Eth2")
} else {
default:
return filepath.Join(home, ".eth2")
}
}