diff --git a/README.md b/README.md index 61f70c5..d2fe1ed 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ func handleClient(client net.Conn) { if numbytes == 0 || err != nil { return } - client.Write(buf) + client.Write(buf[:numbytes]) } } @@ -182,6 +182,7 @@ func main() { - [Mark Berner](https://github.com/mark2b) - [Fatih Kaya](https://github.com/fatihky) - [Jannick Fahlbusch](https://github.com/jannickfahlbusch) +- [TobyZXJ](https://github.com/tobyzxj) All the contributors are welcome. If you would like to be the contributor please accept some rules. - The pull requests will be accepted only in "develop" branch diff --git a/daemon.go b/daemon.go index f05186c..7a7a229 100644 --- a/daemon.go +++ b/daemon.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. /* -Package daemon 0.5.1 for use with Go (golang) services. +Package daemon 0.5.2 for use with Go (golang) services. Package daemon provides primitives for daemonization of golang services. This package is not provide implementation of user daemon, @@ -127,7 +127,7 @@ Example: if numbytes == 0 || err != nil { return } - client.Write(buf) + client.Write(buf[:numbytes]) } } diff --git a/daemon_windows.go b/daemon_windows.go index 263822b..3ef3a4f 100644 --- a/daemon_windows.go +++ b/daemon_windows.go @@ -74,6 +74,7 @@ func (windows *windowsRecord) Start() (string, error) { if err != nil { return startAction + failed, err } + return startAction + " completed.", nil } // Stop the service @@ -84,6 +85,7 @@ func (windows *windowsRecord) Stop() (string, error) { if err != nil { return stopAction + failed, err } + return stopAction + " completed.", nil } // Status - Get service status diff --git a/example/myservice.go b/example/myservice.go index 12fcfe1..0d437b3 100644 --- a/example/myservice.go +++ b/example/myservice.go @@ -113,7 +113,7 @@ func handleClient(client net.Conn) { if numbytes == 0 || err != nil { return } - client.Write(buf) + client.Write(buf[:numbytes]) } }