Code maintenance: OS package for file system

- OS custom internal package for file system interaction
- Remove fileManager external dependency
- Closer API to Go's native API on the OS
- Create directories at startup
- Better testability
- Move Unsetenv to os interface
This commit is contained in:
Quentin McGaw
2020-12-29 00:55:31 +00:00
parent f5366c33bc
commit 73479bab26
43 changed files with 923 additions and 353 deletions

View File

@@ -11,7 +11,7 @@ import (
// GetUser obtains the user to use to connect to the VPN servers.
func (r *reader) GetUser() (s string, err error) {
defer func() {
unsetenvErr := r.unsetEnv("USER")
unsetenvErr := r.os.Unsetenv("USER")
if err == nil {
err = unsetenvErr
}
@@ -22,7 +22,7 @@ func (r *reader) GetUser() (s string, err error) {
// GetPassword obtains the password to use to connect to the VPN servers.
func (r *reader) GetPassword(required bool) (s string, err error) {
defer func() {
unsetenvErr := r.unsetEnv("PASSWORD")
unsetenvErr := r.os.Unsetenv("PASSWORD")
if err == nil {
err = unsetenvErr
}