diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-05-09 13:15:18 +0200 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-05-11 08:35:50 -0300 |
commit | 9bf6eec1a51c49f025454fdfc709b4d29142f84c (patch) | |
tree | 28e6d31ba947be09e6ff5b507147324871a14fe0 /bindings | |
parent | 3760a79b3fd551c389f1216af321d1ab45d0642f (diff) |
go: update the addrlookup utility to go 1
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@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/go/src/notmuch-addrlookup/addrlookup.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bindings/go/src/notmuch-addrlookup/addrlookup.go b/bindings/go/src/notmuch-addrlookup/addrlookup.go index 03699fb4..d1726666 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") |