Skip to content

Commit

Permalink
Fix Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kare committed Nov 8, 2018
1 parent e6ad228 commit d5a5a7b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions example_test.go
@@ -1,17 +1,20 @@
package vanity
package vanity_test

import (
stdlog "log"
"log"
"net/http"
"os"

"kkn.fi/vanity"
)

func ExampleRedirect() {
http.Handle("/", Redirect("git", "kkn.fi", "github.com/kare"))
http.Handle("/", vanity.Redirect("git", "kkn.fi", "github.com/kare"))
// Output:
}

func ExampleSetLogger() {
// stdlog is Go Standard Library's log package
errorLog := stdlog.New(os.Stderr, "vanity: ", stdlog.Ldate|stdlog.Ltime|stdlog.LUTC)
SetLogger(errorLog)
errorLog := log.New(os.Stderr, "vanity: ", log.Ldate|log.Ltime|log.LUTC)
vanity.SetLogger(errorLog)
// Output:
}

0 comments on commit d5a5a7b

Please sign in to comment.