Files
go-ssh-config/example_test.go
Kevin Burke 7897293c53 Cleanup for public release
- Test Include string representation

- Add docs and examples
2017-05-25 08:00:10 -07:00

24 lines
524 B
Go

package ssh_config
import "fmt"
func ExampleHost_Matches() {
pat, _ := NewPattern("test.*.example.com")
host := &Host{Patterns: []*Pattern{pat}}
fmt.Println(host.Matches("test.stage.example.com"))
fmt.Println(host.Matches("othersubdomain.example.com"))
// Output:
// true
// false
}
func ExamplePattern() {
pat, _ := NewPattern("*")
host := &Host{Patterns: []*Pattern{pat}}
fmt.Println(host.Matches("test.stage.example.com"))
fmt.Println(host.Matches("othersubdomain.any.any"))
// Output:
// true
// true
}