[PATCH 3/5] go: update the addrlookup utility to go 1
Justus Winter
4winter at informatik.uni-hamburg.de
Wed May 9 04:15:18 PDT 2012
Use the new built in error type that replaces os.Error, adapt the code
to the fact that strings.Split has just two arguments now.
Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de>
---
bindings/go/src/notmuch-addrlookup/addrlookup.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bindings/go/src/notmuch-addrlookup/addrlookup.go b/bindings/go/src/notmuch-addrlookup/addrlookup.go
index 03699fb..d172666 100644
--- a/bindings/go/src/notmuch-addrlookup/addrlookup.go
+++ b/bindings/go/src/notmuch-addrlookup/addrlookup.go
@@ -86,7 +86,7 @@ func addresses_by_frequency(msgs *notmuch.Messages, name string, pass uint, addr
// "<?(?P<mail>\\b\\w+([-+.]\\w+)*\\@\\w+[-\\.\\w]*\\.([-\\.\\w]+)*\\w\\b)>?)"
pattern = `.*` + strings.ToLower(name) + `.*`
var re *regexp.Regexp = nil
- var err os.Error = nil
+ var err error = nil
if re,err = regexp.Compile(pattern); err != nil {
log.Printf("error: %v\n", err)
return &freqs
@@ -103,7 +103,7 @@ func addresses_by_frequency(msgs *notmuch.Messages, name string, pass uint, addr
for _,header := range headers {
froms := strings.ToLower(msg.GetHeader(header))
//println(" froms: ["+froms+"]")
- for _,from := range strings.Split(froms, ",", -1) {
+ for _,from := range strings.Split(froms, ",") {
from = strings.Trim(from, " ")
match := re.FindString(from)
//println(" -> match: ["+match+"]")
@@ -179,7 +179,7 @@ type address_matcher struct {
func new_address_matcher() *address_matcher {
var cfg *config.Config
- var err os.Error
+ var err error
// honor NOTMUCH_CONFIG
home := os.Getenv("NOTMUCH_CONFIG")
--
1.7.10
More information about the notmuch
mailing list