(format lint.Formatter)
| 142 | } |
| 143 | |
| 144 | func (reg *registry) RegisterFormatter(format lint.Formatter) error { |
| 145 | reg.mut.Lock() |
| 146 | defer reg.mut.Unlock() |
| 147 | |
| 148 | _, ok := reg.allFormatters[format.Name()] |
| 149 | if ok { |
| 150 | return fmt.Errorf("'%s' formatter already registered", format.Name()) |
| 151 | } |
| 152 | |
| 153 | reg.allFormatters[format.Name()] = format |
| 154 | |
| 155 | return nil |
| 156 | } |
| 157 | |
| 158 | func (reg *registry) GetRule(name string) (lint.Rule, bool) { |
| 159 | reg.mut.Lock() |
no test coverage detected