samber / slog-syslog

🚨 slog: Syslog handler
https://pkg.go.dev/github.com/samber/slog-syslog/v2
MIT License
13 stars 4 forks source link

Example doesn't build #3

Closed neutralinsomniac closed 1 year ago

neutralinsomniac commented 1 year ago

The imports in your example need to be updated:

import (
    "fmt"
    "log"
    "log/slog"
    "net"
    "time"

    slogsyslog "github.com/samber/slog-syslog"
)
samber commented 1 year ago

Can you be more explicit, please ?

neutralinsomniac commented 1 year ago

Your example in README.md doesn't compile without adding these imports :)

diff --git a/README.md b/README.md
index 7b15662..025ea10 100644
--- a/README.md
+++ b/README.md
@@ -71,9 +71,13 @@ Attributes will be injected in log payload.

 ```go
 import (
+   "fmt"
+   "log"
+   "log/slog"
    "net"
+   "time"
+
    slogsyslog "github.com/samber/slog-syslog"
-   "log/slog"
 )

 func main() {
samber commented 1 year ago

ok, I thank you were talking about example.go

fixed