1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-22 09:12:19 +00:00

Remove ineffectual assignments

This commit is contained in:
Alexandre Iooss 2020-10-14 21:33:51 +02:00
parent e53d5a02ab
commit c3629bdbb5
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
3 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@ type Backend interface {
// New initialize authentification backend
func New(cfg *Options) (Backend, error) {
var backend Backend = nil
var backend Backend
var err error
if !cfg.Enabled {

View File

@ -85,6 +85,9 @@ func Load() (*Config, error) {
configuro.WithLoadFromConfigFile("/etc/ghostream/ghostream.yml", false),
configuro.WithEnvConfigPathOverload("GHOSTREAM_CONFIG"),
)
if err != nil {
return nil, err
}
// Load default configuration
cfg := New()

View File

@ -28,13 +28,13 @@ func TestSplitHostPort(t *testing.T) {
}
// Split demo, should fail
host, port, err = splitHostPort("demo")
_, _, err = splitHostPort("demo")
if err == nil {
t.Errorf("splitHostPort managed to split unsplitable hostport")
}
// Split demo:port, should fail
host, port, err = splitHostPort("demo:port")
_, _, err = splitHostPort("demo:port")
if err == nil {
t.Errorf("splitHostPort managed to split unsplitable hostport")
}