@@ -96,7 +96,7 @@ func (c *Config) Read(file string) error {
9696 if err != nil {
9797 return err
9898 }
99- file = fmt . Sprintf ( "%s/%s" , home , File )
99+ file = filepath . Join ( home , File )
100100 }
101101
102102 if _ , err := os .Stat (file ); err != nil {
@@ -176,7 +176,7 @@ func (c *Config) configure() (*Config, error) {
176176 if err != nil {
177177 return c , err
178178 }
179- c .file = fmt . Sprintf ( "%s/%s" , dir , File )
179+ c .file = filepath . Join ( dir , File )
180180
181181 // use legacy value, if it exists
182182 if c .ExercismDirectory != "" {
@@ -185,7 +185,7 @@ func (c *Config) configure() (*Config, error) {
185185
186186 // fall back to default value
187187 if c .Dir == "" {
188- c .Dir = fmt . Sprintf ( "%s/%s" , dir , DirExercises )
188+ c .Dir = filepath . Join ( dir , DirExercises )
189189 }
190190 c .Dir = strings .Replace (c .Dir , "~/" , fmt .Sprintf ("%s/" , dir ), 1 )
191191 return c , nil
@@ -201,7 +201,7 @@ func FilePath(file string) (string, error) {
201201 if err != nil {
202202 return "" , err
203203 }
204- return fmt . Sprintf ( "%s/%s" , dir , File ), nil
204+ return filepath . Join ( dir , File ), nil
205205}
206206
207207// IsAuthenticated returns true if the config contains an API key.
0 commit comments