package markinfo import "fmt" const ( DATA_TICK = iota DATA_EASYFOREX DATA_OANDA SourceCount ) var sources = map[int16] string { DATA_TICK : "TICK", DATA_EASYFOREX : "EASYFOREX", DATA_OANDA : "OANDA", } func SourceName(id int16) (t string, err error) { value, ok := sources[id] if !ok { return "", fmt.Errorf("SourceName source_id %d not exist", id) } return value, nil }