From 43a8b311bc4d90aee5950b5c66866f583264a5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 27 May 2020 18:18:41 +0200 Subject: [PATCH] Un-publish `Hosts` from the Config interface It's not being depended on anywhere right now, so this minimizes the public interface. --- internal/config/config_type.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/config/config_type.go b/internal/config/config_type.go index e37c3e884..6517e1be3 100644 --- a/internal/config/config_type.go +++ b/internal/config/config_type.go @@ -12,7 +12,6 @@ const defaultGitProtocol = "https" // This interface describes interacting with some persistent configuration for gh. type Config interface { - Hosts() ([]*HostConfig, error) Get(string, string) (string, error) Set(string, string, string) error Write() error @@ -145,7 +144,7 @@ func (c *fileConfig) Set(hostname, key, value string) error { } func (c *fileConfig) configForHost(hostname string) (*HostConfig, error) { - hosts, err := c.Hosts() + hosts, err := c.hostEntries() if err != nil { return nil, fmt.Errorf("failed to parse hosts config: %w", err) } @@ -167,7 +166,7 @@ func (c *fileConfig) Write() error { return WriteConfigFile(ConfigFile(), marshalled) } -func (c *fileConfig) Hosts() ([]*HostConfig, error) { +func (c *fileConfig) hostEntries() ([]*HostConfig, error) { if len(c.hosts) > 0 { return c.hosts, nil }