1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-05 17:37:03 +00:00

Minor code aesthetic improvements, based on vet+fmt+lint

This patch is the result of running go vet, go fmt -s and the linter,
and fixing some of the things they noted/suggested.

There shouldn't be any significant logic changes, it's mostly
readability improvements.
This commit is contained in:
Alberto Bertogli
2016-10-13 00:32:06 +01:00
parent a5e6e197a6
commit 1d7a207e00
7 changed files with 42 additions and 40 deletions

View File

@@ -74,6 +74,7 @@ type Recipient struct {
type RType string
// Valid recipient types.
const (
EMAIL RType = "(email)"
PIPE RType = "(pipe)"
@@ -148,7 +149,7 @@ func (v *Resolver) resolve(rcount int, addr string) ([]Recipient, error) {
rcpts := v.aliases[addr]
if len(rcpts) == 0 {
return []Recipient{Recipient{addr, EMAIL}}, nil
return []Recipient{{addr, EMAIL}}, nil
}
ret := []Recipient{}
@@ -285,7 +286,7 @@ func parseFile(domain, path string) (map[string][]Recipient, error) {
if rawalias[0] == '|' {
cmd := strings.TrimSpace(rawalias[1:])
aliases[addr] = []Recipient{Recipient{cmd, PIPE}}
aliases[addr] = []Recipient{{cmd, PIPE}}
} else {
rs := []Recipient{}
for _, a := range strings.Split(rawalias, ",") {