// +build windows

package config

import (
	"fmt"
	"os"
	"path/filepath"
)

func Open(filename string) (*os.File, error) {
	dir := os.Getenv("LOCALAPPDATA")
	if dir == "" {
		return nil, fmt.Errorf("Could not find %%LOCALAPPDATA%% envar")
	}

	f, err := os.Open(filepath.Join(dir, filename))
	return f, err
}

// +build windows

// Package config wraps xdgdir.Config to allow for OS-independent configuration.
package config

import (
	"fmt"
	"os"
	"path/filepath"
)

func Open(filename string) (*os.File, error) {
	dir := os.Getenv("USERPROFILE")
	if dir == "" {
		return nil, fmt.Errorf("Could not find %%USERPROFILE%% envar")
	}

	f, err := os.Open(filepath.Join(dir, filename))
	return f, err
}

--- 
+++ 
@@ -1,6 +1,5 @@
 // +build windows
 
-// Package config wraps xdgdir.Config to allow for OS-independent configuration.
 package config
 
 import (
@@ -10,9 +9,9 @@
 )
 
 func Open(filename string) (*os.File, error) {
-	dir := os.Getenv("USERPROFILE")
+	dir := os.Getenv("LOCALAPPDATA")
 	if dir == "" {
-		return nil, fmt.Errorf("Could not find %%USERPROFILE%% envar")
+		return nil, fmt.Errorf("Could not find %%LOCALAPPDATA%% envar")
 	}
 
 	f, err := os.Open(filepath.Join(dir, filename))
Use the correct envar for Windows
