Skip to content

Instantly share code, notes, and snippets.

@178inaba
Last active December 16, 2015 02:32
Show Gist options
  • Select an option

  • Save 178inaba/11523503f29f46a137c1 to your computer and use it in GitHub Desktop.

Select an option

Save 178inaba/11523503f29f46a137c1 to your computer and use it in GitHub Desktop.
it is a different type, but content to cast the same type. (ex. gin.H -> pongo2.Context)
package main
import "fmt"
type H map[string]interface{}
type Context map[string]interface{}
func main() {
var h H
h = H{"message": "hello", "status": 200}
var context Context
context = Context(h)
fmt.Println(h, context)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment