Skip to content

Commit

Permalink
handler err in samples (zserge#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalpowar authored and zserge committed Feb 13, 2019
1 parent f2126c5 commit cf09052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/hello/main.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package main

import (
"log"
"net/url"

"github.com/zserge/lorca"
)

func main() {
// Create UI with basic HTML passed via data URI
ui, _ := lorca.New("data:text/html,"+url.PathEscape(`
ui, err := lorca.New("data:text/html,"+url.PathEscape(`
<html>
<head><title>Hello</title></head>
<body><h1>Hello, world!</h1></body>
</html>
`), "", 480, 320)
if err != nil {
log.Fatal(err)
}
defer ui.Close()
// Wait until UI window is closed
<-ui.Done()
Expand Down
6 changes: 5 additions & 1 deletion examples/stopwatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"log"
"net/url"
"sync/atomic"
"time"
Expand All @@ -10,7 +11,10 @@ import (
)

func main() {
ui, _ := lorca.New("", "", 480, 320)
ui, err := lorca.New("", "", 480, 320)
if err != nil {
log.Fatal(err)
}
defer ui.Close()

// Data model: number of ticks
Expand Down

0 comments on commit cf09052

Please sign in to comment.