Compare commits

..

No commits in common. "7d0620fe3e42cfbc2f05984a4118def463aedaab" and "e0c8825949d40c1a9d489e100cf214bbe1463085" have entirely different histories.

3 changed files with 2 additions and 14 deletions

View File

@ -29,14 +29,6 @@ type Actor interface {
Type() string
}
// Named is any object with a name.
type Named() string {
// Name returns the name. This doesn't need to be the same as Type. It
// must return the same string every time. It is used to differentiate
// actors of the same type in logs.
Name() string
}
// FlagAdder is any object that can add [Flag]s to a [FlagSet]. Actors which
// implement this interface will be called upon to add flags during and only
// during the flag parsing phase.

2
ini.go
View File

@ -162,7 +162,7 @@ func configFiles(program string) ([]string, error) {
userConfig, err := os.UserConfigDir()
if err != nil { return nil, err }
return []string {
filepath.Join("/etc", program, program + ".conf"),
filepath.Join("/etc", program),
filepath.Join(userConfig, program),
}, nil
}

View File

@ -77,11 +77,7 @@ func logActors (actors iter.Seq[Actor]) {
}
types := make(map[string] int)
for actor := range actors {
typ := actor.Type()
if named, ok := actor.(Named); ok {
typ = fmt.Sprintf("%s/%s", typ, named.Name())
}
types[typ] += 1
types[actor.Type()] += 1
}
for typ, count := range types {
if count > 1 {