- rename constructors to New - remove Get/Set-style accessors - replace string-based enums with iota-backed types
25 lines
262 B
Go
25 lines
262 B
Go
package slug
|
|
|
|
type Slug interface {
|
|
String() string
|
|
Set(slug string)
|
|
}
|
|
|
|
type slug struct {
|
|
slug string
|
|
}
|
|
|
|
func New() Slug {
|
|
return &slug{
|
|
slug: "",
|
|
}
|
|
}
|
|
|
|
func (s *slug) String() string {
|
|
return s.slug
|
|
}
|
|
|
|
func (s *slug) Set(slug string) {
|
|
s.slug = slug
|
|
}
|