From 3ad0b67af6aeb296afcf42faddb1c970821d8096 Mon Sep 17 00:00:00 2001 From: Christian Joergensen Date: Thu, 24 Aug 2017 11:41:02 +0200 Subject: [PATCH] Add Go Report Card, fix a couple of golint warnings. --- README.md | 2 +- example_test.go | 3 ++- protocol.go | 9 ++++----- smtpd.go | 7 +++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7104171..18698ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Go smtpd [![GoDoc](https://godoc.org/github.com/chrj/smtpd?status.png)](https://godoc.org/github.com/chrj/smtpd) +Go smtpd [![GoDoc](https://godoc.org/github.com/chrj/smtpd?status.png)](https://godoc.org/github.com/chrj/smtpd) [![Go Report Card](https://goreportcard.com/badge/github.com/chrj/smtpd)](https://goreportcard.com/report/github.com/chrj/smtpd) ======== Package smtpd implements an SMTP server in golang. diff --git a/example_test.go b/example_test.go index e50fff5..a61241e 100644 --- a/example_test.go +++ b/example_test.go @@ -1,10 +1,11 @@ package smtpd_test import ( - "github.com/chrj/smtpd" "errors" "net/smtp" "strings" + + "github.com/chrj/smtpd" ) func ExampleServer() { diff --git a/protocol.go b/protocol.go index 16117ac..c4fdca8 100644 --- a/protocol.go +++ b/protocol.go @@ -524,11 +524,10 @@ func (session *session) handleXCLIENT(cmd command) { } var ( - newHeloName = "" - newAddr net.IP = nil - newTCPPort uint64 = 0 - newUsername = "" - newProto Protocol = "" + newHeloName, newUsername string + newProto Protocol + newAddr net.IP + newTCPPort uint64 ) for _, item := range cmd.fields[1:] { diff --git a/smtpd.go b/smtpd.go index ec2e7a3..88f23fc 100644 --- a/smtpd.go +++ b/smtpd.go @@ -55,8 +55,11 @@ type Server struct { type Protocol string const ( - SMTP Protocol = "SMTP" - ESMTP = "ESMTP" + // SMTP + SMTP Protocol = "SMTP" + + // Extended SMTP + ESMTP = "ESMTP" ) // Peer represents the client connecting to the server