I have created the custom type with like following.
import (
"encoding/json"
"log"
"log/syslog"
"strconv"
"time"
)
type MyLogger struct {
w *syslog.Writer
LogName string
}
And I'm getting error syslog.writer undefined. Even I tried the same in golang play ground and its giving same error.
According to https://blog.golang.org/playground,
To isolate user programs from Google's infrastructure, the back end runs them under Native Client (or "NaCl")
And from the https://golang.org/pkg/log/syslog/
This package is not implemented on Windows. As the syslog package is frozen, Windows users are encouraged to use a package outside of the standard library. For background, see https://golang.org/issue/1108.
This package is not implemented on Plan 9.
This package is not implemented on NaCl (Native Client).
You are using Windows, and Go Playground is using NaCl, which both syslog is not implemented.