File tree Expand file tree Collapse file tree 4 files changed +0
-7
lines changed Expand file tree Collapse file tree 4 files changed +0
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ func main() {
21
21
22
22
http .HandleFunc ("/" , handler )
23
23
err := http .ListenAndServe (addr , nil )
24
-
25
24
if err != nil {
26
25
fmt .Print (err )
27
26
}
@@ -65,7 +64,6 @@ func getAddr() string {
65
64
// itself is healthy.
66
65
func doHealthcheck () {
67
66
_ , err := State ()
68
-
69
67
if err != nil {
70
68
os .Exit (1 )
71
69
}
Original file line number Diff line number Diff line change @@ -22,15 +22,13 @@ func (s *SystemdState) IsRunning() bool {
22
22
// State returns the systemd state.
23
23
func State () (SystemdState , error ) {
24
24
conn , err := dbus .NewSystemdConnection ()
25
-
26
25
if err != nil {
27
26
return SystemdState {}, err
28
27
}
29
28
30
29
defer conn .Close ()
31
30
32
31
p , err := conn .SystemState ()
33
-
34
32
if err != nil {
35
33
return SystemdState {}, err
36
34
}
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ func makeState(s string) SystemdState {
13
13
}
14
14
15
15
func TestStateIsRunning (t * testing.T ) {
16
-
17
16
running := makeState ("running" )
18
17
19
18
if ! running .IsRunning () {
@@ -62,7 +61,6 @@ func TestStateString(t *testing.T) {
62
61
63
62
func TestGetState (t * testing.T ) {
64
63
_ , err := State ()
65
-
66
64
if err != nil {
67
65
t .Skipf ("Could not get state: %v" , err )
68
66
}
Original file line number Diff line number Diff line change @@ -47,5 +47,4 @@ func TestStatusFormatError(t *testing.T) {
47
47
if errorStateFormat .State != "some error" {
48
48
t .Errorf ("Expected \" %s\" " , errorStateFormat .State )
49
49
}
50
-
51
50
}
You can’t perform that action at this time.
0 commit comments