chore: add new formatter to .golangci.yml
All checks were successful
build / build (push) Successful in 2m23s

This commit is contained in:
d3m0k1d
2026-01-19 18:57:11 +03:00
parent a1321300cb
commit 46dc54f5a7
8 changed files with 80 additions and 11 deletions

View File

@@ -25,7 +25,14 @@ func LoadRuleConfig() ([]Rule, error) {
return cfg.Rules, nil
}
func NewRule(Name string, ServiceName string, Path string, Status string, Method string, ttl string) error {
func NewRule(
Name string,
ServiceName string,
Path string,
Status string,
Method string,
ttl string,
) error {
r, err := LoadRuleConfig()
if err != nil {
r = []Rule{}
@@ -34,7 +41,17 @@ func NewRule(Name string, ServiceName string, Path string, Status string, Method
fmt.Printf("Rule name can't be empty\n")
return nil
}
r = append(r, Rule{Name: Name, ServiceName: ServiceName, Path: Path, Status: Status, Method: Method, BanTime: ttl})
r = append(
r,
Rule{
Name: Name,
ServiceName: ServiceName,
Path: Path,
Status: Status,
Method: Method,
BanTime: ttl,
},
)
file, err := os.Create("/etc/banforge/rules.toml")
if err != nil {
return err