phalaaxx / milter

A golang library for milter support
BSD 2-Clause "Simplified" License
46 stars 22 forks source link

Errors while performing a go get #12

Closed bc547 closed 6 years ago

bc547 commented 6 years ago

When doing a

go get github.com/phalaaxx/milter

I get the following error:

# github.com/phalaaxx/milter
\github.com\phalaaxx\milter\server.go:23:11: cannot use actions (type OptAction) as type uint32 in field value
\github.com\phalaaxx\milter\server.go:24:12: cannot use protocol (type OptProtocol) as type uint32 in field value `

This modification fixes the issue:

diff --git a/server.go b/server.go
index 5c152f4..5df9bb6 100644
--- a/server.go
+++ b/server.go
@@ -20,8 +20,8 @@ func RunServer(server net.Listener, init MilterInit) error {
                // create milter object
                milter, actions, protocol := init()
                session := milterSession{
-                       actions:  actions,
-                       protocol: protocol,
+                       actions:  uint32(actions),
+                       protocol: uint32(protocol),
                        sock:     client,
                        milter:   milter,
                }
phalaaxx commented 6 years ago

Can you please try with ddacab8?

bc547 commented 6 years ago

a 'go get' works perfectly now 👍 Thanks!