409 })
410}
411
412func (ss Services) Routable() Services {413 return ss.Filter(func(s Service) bool {
414 return s.Port.Port > 0
415 })
403 return fss
404}
405
406func (ss Services) InternalRouter() Services {407 return ss.Filter(func(s Service) bool {
408 return s.InternalRouter
409 })
390 })
391}
392
393func (ss Services) Filter(fn func(s Service) bool) Services {394 fss := Services{}
395
396 // skipcq
384 return srs
385}
386
387func (ss Services) External() Services {388 return ss.Filter(func(s Service) bool {
389 return !s.Internal && !s.InternalRouter
390 })
565 return marshalMapSlice(v)
566}
567
568func (v *Timers) UnmarshalYAML(unmarshal func(interface{}) error) error {569 return unmarshalMapSlice(unmarshal, v)
570}
571
(Go's FAQ)[https://go.dev/doc/faq#methodsonvaluesorpointers] recommends that method receivers should be consistent. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. This is because value and pointer receivers have different method sets.
package main
type foo struct {
a int
}
func (f foo) a() {}
func (f *foo) b() {
f.a = 10
}
package main
type foo struct {
a int
}
func (f *foo) a() {}
func (f *foo) b() {
f.a = 10
}