mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-21 00:47:11 +08:00
23 lines
291 B
Go
23 lines
291 B
Go
package main
|
|
|
|
func main() {
|
|
w := newWatcher()
|
|
defer w.close()
|
|
|
|
// Run the application
|
|
}
|
|
|
|
func newWatcher() watcher {
|
|
w := watcher{}
|
|
go w.watch()
|
|
return w
|
|
}
|
|
|
|
type watcher struct { /* Some resources */
|
|
}
|
|
|
|
func (w watcher) watch() {}
|
|
|
|
func (w watcher) close() {
|
|
// Close the resources
|
|
}
|