diff --git a/app/router/balancing.go b/app/router/balancing.go index dae2da59f..73d3ac101 100644 --- a/app/router/balancing.go +++ b/app/router/balancing.go @@ -27,7 +27,7 @@ type Balancer struct { override override } -// PickOutbound picks the tag of a outbound +// PickOutbound picks the tag of an outbound func (b *Balancer) PickOutbound() (string, error) { candidates, err := b.SelectOutbounds() if err != nil { diff --git a/app/router/condition.go b/app/router/condition.go index 30bdf6f05..499d47e96 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -149,7 +149,7 @@ type PortMatcher struct { onSource bool } -// NewPortMatcher create a new port matcher that can match source or destination port +// NewPortMatcher creates a new port matcher that can match source or destination port func NewPortMatcher(list *net.PortList, onSource bool) *PortMatcher { return &PortMatcher{ port: net.PortListFromProto(list), diff --git a/app/router/router.go b/app/router/router.go index 85aab1571..0cafdc15f 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -126,7 +126,7 @@ func (r *Router) Close() error { return nil } -// Type implement common.HasType. +// Type implements common.HasType. func (*Router) Type() interface{} { return routing.RouterType() } diff --git a/app/router/weight.go b/app/router/weight.go index f60d24c71..ec7711b99 100644 --- a/app/router/weight.go +++ b/app/router/weight.go @@ -28,7 +28,7 @@ type WeightManager struct { defaultWeight float64 } -// Get get the weight of specified tag +// Get gets the weight of specified tag func (s *WeightManager) Get(tag string) float64 { weight, ok := s.cache[tag] if ok { diff --git a/common/strmatcher/matchers.go b/common/strmatcher/matchers.go index 79ed3c176..c5d6fcdfc 100644 --- a/common/strmatcher/matchers.go +++ b/common/strmatcher/matchers.go @@ -133,7 +133,7 @@ type MatcherGroupForRegex interface { AddRegexMatcher(matcher *RegexMatcher, value uint32) } -// AddMatcherGroup is a helper function to try to add a Matcher to any kind of MatcherGroup. +// AddMatcherToGroup is a helper function to try to add a Matcher to any kind of MatcherGroup. // It returns error if the MatcherGroup does not accept the provided Matcher's type. // This function is provided to help writing code to test a MatcherGroup. func AddMatcherToGroup(g MatcherGroup, matcher Matcher, value uint32) error {