context

command
v0.0.0-...-a092d62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 7 Imported by: 0

README

Go context samples

prog1

the http server sample it is configured timeout by context.

$ go run prog1.go
all: baz, 
all: baz, foo, 
all: baz, foo, qux, 
all: baz, foo, qux, bar, 
Response: baz, foo, qux, bar,  (719.454247ms)

prog2

the sample code for context.WithCancel.

$ go run prog2.go
start infLoop
do cancel
  exit infLoop

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL