Your map is not initialized, do either var us = make(map[string]core.MyContext) or var us = map[string]core.MyContext{}
See https://golang.org/ref/spec#Map_types Le mercredi 16 novembre 2016 15:05:54 UTC+1, sandi...@gmail.com a écrit : > > package core > > type MyContext struct { > CurClazz string > CurLine int > } > > > -------------------------------------------------------------------------------------------------------------- > package main > > import ( > "fmt" > "pkg/core" > ) > > > var us = map[string]core.MyContext > > > > -------------------------------------------------------------------------------- > > I am new to GoLang. Above code is giving build error "type > map[string]core.MyContext is not an expression". Can someone please help? > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.