From dc8ec51530237f45a4faca7800d48ba170dd08de Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 7 Feb 2023 02:29:45 +0400 Subject: [PATCH] Func LoadConfiguration() was renamed to Load(). Added a comment for it. Edited a comment for SplitNetworkAddress() func. --- internal/configuration/configuration.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/configuration/configuration.go b/internal/configuration/configuration.go index 56be846..3e7e149 100644 --- a/internal/configuration/configuration.go +++ b/internal/configuration/configuration.go @@ -24,7 +24,8 @@ type Configuration struct { } `yaml:"log"` } -func LoadConfiguration(path string) (*Configuration, error) { +// Load reads a YAML file that stores configuration of a service. +func Load(path string) (*Configuration, error) { configFile, err := os.Open(path) if err != nil { return nil, errors.Wrap(err, "failed to open configuration file") @@ -40,9 +41,8 @@ func LoadConfiguration(path string) (*Configuration, error) { return config, nil } -// SplitNetworkAddress splits ListenOn option and returns as two strings -// network type (e.g. tcp, unix, udp) and address:port or /path/to/prog.socket -// to listen on. +// SplitNetworkAddress splits ListenOn option into network type (e.g. tcp, unix, +// udp) and address:port or /path/to/service.socket to listen on. func (c *Configuration) SplitNetworkAddress() (string, string) { s := strings.Split(c.ListenOn, " ") return s[0], s[1]