You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
550 B
36 lines
550 B
package mime_test
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"gitoa.ru/go-4devs/mime"
|
|
)
|
|
|
|
func ExampleMime_String() {
|
|
fmt.Printf("%v", mime.TextHTML)
|
|
|
|
// Output:
|
|
// text/html
|
|
}
|
|
|
|
func ExampleMime_Is() {
|
|
fmt.Printf("%v\n%v",
|
|
mime.TextHTML.Is(mime.ApplicationJSON, mime.ApplicationJavascript),
|
|
mime.TextHTML.Is(mime.ApplicationJavascript, mime.TextHTML),
|
|
)
|
|
|
|
// Output:
|
|
// false
|
|
// true
|
|
}
|
|
|
|
func ExampleMime_ExtTypes() {
|
|
fmt.Printf("%v\n%v",
|
|
mime.TextHTML.ExtTypes(),
|
|
mime.ApplicationJavascript.ExtTypes(),
|
|
)
|
|
|
|
// Output:
|
|
// [html htm shtml]
|
|
// [js mjs jsm]
|
|
}
|
|
|