I am currently running Windows 8 64-bit and I am trying to create a logging file for use with a web server. The code in question is:
func LogWebPath(requestedURL string, accessedURL string, logFile string) error {
file, _ := os.Open(logFile)
_, err = io.WriteString(file, requestedURL + ":" + accessedURL)
if(err != nil) {
fmt.Println(err)
return err
}
file.Close()
return errors.New("nil")
}
Whenever io.WriteString is called, the error returned is write log/visit.log: Access is denied.
I have Go installed on my system and I am using go run x.go
to run my Go source.