mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-07 06:57:37 +03:00
To keep it separate from other code in 'config' package that now contains many shared configuration matchers.
18 lines
309 B
Go
18 lines
309 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/foxcpp/maddy/config/parser"
|
|
)
|
|
|
|
type (
|
|
Node = parser.Node
|
|
)
|
|
|
|
func NodeErr(node *Node, f string, args ...interface{}) error {
|
|
if node.File == "" {
|
|
return fmt.Errorf(f, args...)
|
|
}
|
|
return fmt.Errorf("%s:%d: %s", node.File, node.Line, fmt.Sprintf(f, args...))
|
|
}
|