Skip to content

Commit f84e9d8

Browse files
committed
Adjustment from the tests.
1 parent a9eb950 commit f84e9d8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

host.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262
// ...
6363
//
6464
// // When you need to uninstall.
65-
// if err := host.Uninstall(); err != nil {
66-
// log.Printf("uninstall error: %v", err)
67-
// }
65+
// host.Uninstall()
6866
//
6967
// * Auto Update Configuration
7068
//
@@ -98,13 +96,23 @@ import (
9896
"encoding/binary"
9997
"encoding/json"
10098
"io"
99+
"io/ioutil"
101100
"os"
102101
"path"
103102
"path/filepath"
104103
"runtime"
105104
"strings"
106105
)
107106

107+
// ioutilWriteFile is a shortcut to ioutil.WriteFile. It helps write testable code.
108+
var ioutilWriteFile = ioutil.WriteFile
109+
110+
// osMkdirAll is a shortcut to os.MkdirAll. It helps write testable code.
111+
var osMkdirAll = os.MkdirAll
112+
113+
// runtimeGoexit is a shortcut to runtime.Goexit. It helps write testable code.
114+
var runtimeGoexit = runtime.Goexit
115+
108116
// H is a map[string]interface{} type shortcut and represents a dynamic
109117
// key-value-pair data.
110118
type H map[string]interface{}
@@ -123,9 +131,6 @@ type Host struct {
123131
Version string `json:"-"`
124132
}
125133

126-
// runtimeGoexit is a shortcut to runtime.Goexit. It helps write testable code.
127-
var runtimeGoexit = runtime.Goexit
128-
129134
// Init sets default value to its fields and return the Host pointer back.
130135
//
131136
// * AppName is an application name in manifest file and will be defaulted to

0 commit comments

Comments
 (0)