Skip to content

Commit 2796faf

Browse files
committed
Delete left-over function
1 parent 3f7f0f0 commit 2796faf

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

‎config/config.go‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,6 @@ func (c *Config) configure() (*Config, error) {
215215
return c, nil
216216
}
217217

218-
// FilePath returns the path to the config file.
219-
func FilePath(file string) (string, error) {
220-
if file != "" {
221-
return file, nil
222-
}
223-
224-
dir, err := Home()
225-
if err != nil {
226-
return "", err
227-
}
228-
return filepath.Join(dir, File), nil
229-
}
230-
231218
// IsAuthenticated returns true if the config contains an API key.
232219
// This does not check whether or not that key is valid.
233220
func (c *Config) IsAuthenticated() bool {

‎config/config_test.go‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,6 @@ func TestSanitizeWhitespace(t *testing.T) {
8585
assert.Equal(t, "http://x.exercism.io", c.XAPI)
8686
}
8787

88-
func TestFilePath(t *testing.T) {
89-
// defaults to home directory
90-
c := &Config{}
91-
c.home = "/home/alice"
92-
c.configure()
93-
assert.Equal(t, filepath.FromSlash("/home/alice/.exercism.json"), c.File)
94-
95-
// can override location of config file
96-
c = &Config{}
97-
c.configure()
98-
c.SavePath("/tmp/config/exercism.conf")
99-
assert.Equal(t, "/tmp/config/exercism.conf", c.File)
100-
}
101-
10288
func TestReadNonexistantConfig(t *testing.T) {
10389
c, err := Read("/no/such/config.json")
10490
assert.NoError(t, err)

0 commit comments

Comments
 (0)