andrey1s
2 years ago
1 changed files with 36 additions and 0 deletions
@ -0,0 +1,36 @@ |
|||
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]
|
|||
} |
Loading…
Reference in new issue