Skip to content

Commit f5fdf69

Browse files
committed
Fix bad example for boolean options
1 parent 94c737a commit f5fdf69

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Just replace `http.ListenAndServe` with `anyhttp.ListenAndServe`.
1717

1818
Syntax
1919

20-
unix?path=<socket_path>&mode=<socket file mode>&remove_existing=<yes|no>
20+
unix?path=<socket_path>&mode=<socket file mode>&remove_existing=<true|false>
2121

2222
Examples
2323

2424
unix?path=relative/path.sock
2525
unix?path=/var/run/app/absolutepath.sock
26-
unix?path=/run/app.sock&mode=600&remove_existing=no
26+
unix?path=/run/app.sock&mode=600&remove_existing=false
2727

2828
| option | description | default |
2929
|-----------------|------------------------------------------------|----------|
@@ -35,7 +35,7 @@ Examples
3535

3636
Syntax
3737

38-
sysd?idx=<fd index>&name=<fd name>&check_pid=<yes|no>&unset_env=<yes|no>&idle_timeout=<duration>
38+
sysd?idx=<fd index>&name=<fd name>&check_pid=<true|false>&unset_env=<true|false>&idle_timeout=<duration>
3939

4040
Only one of `idx` or `name` has to be set
4141

anyhttp_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ func Test_parseAddress(t *testing.T) {
7272
wantSysc: nil,
7373
wantErr: true,
7474
},
75+
{
76+
name: "systemd address with check_pid and unset_env",
77+
addr: "sysd?idx=0&check_pid=false&unset_env=f",
78+
wantAddrType: SystemdFD,
79+
wantUsc: nil,
80+
wantSysc: &SysdConfig{
81+
FDIndex: ptr(0),
82+
FDName: nil,
83+
CheckPID: false,
84+
UnsetEnv: false,
85+
IdleTimeout: nil,
86+
},
87+
wantErr: false,
88+
},
7589
}
7690
for _, tt := range tests {
7791
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)