system/internal/xcb: refactor and clean up
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 1m52s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 3m39s
Test / Sandbox (race detector) (push) Successful in 4m17s
Test / Hakurei (race detector) (push) Successful in 5m22s
Test / Flake checks (push) Successful in 1m36s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 1m52s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 3m39s
Test / Sandbox (race detector) (push) Successful in 4m17s
Test / Hakurei (race detector) (push) Successful in 5m22s
Test / Flake checks (push) Successful in 1m36s
This package still does not deserve to be out of internal, but at least it is less haunting now. I am still not handling the xcb error though, the struct is almost entirely undocumented and the implementation is unreadable. Not even going to try. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
17
system/internal/xcb/changehosts.go
Normal file
17
system/internal/xcb/changehosts.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package xcb
|
||||
|
||||
import "errors"
|
||||
|
||||
var ErrChangeHosts = errors.New("xcb_change_hosts() failed")
|
||||
|
||||
func ChangeHosts(mode HostMode, family Family, address string) error {
|
||||
conn := new(connection)
|
||||
if err := conn.connect(); err != nil {
|
||||
conn.disconnect()
|
||||
return err
|
||||
} else {
|
||||
defer conn.disconnect()
|
||||
}
|
||||
|
||||
return conn.changeHostsChecked(mode, family, address)
|
||||
}
|
||||
Reference in New Issue
Block a user