code: func (sd structDef) Imports() []string {
  	ip := map[string]struct{}{}
  
  	if sd.needFmt() {
  		ip[`"fmt"`] = struct{}{}
  	}
  	if sd.OneLineDef == "" {
  		ip[`"gopkg.in/validator.v2"`] = struct{}{}
  	}
  
  	// libraries
  	for _, fd := range sd.Fields {
  		if fd.fieldType == "json.RawMessage" {
  			ip[`"encoding/json"`] = struct{}{}
  		} else if lib := libImportPath(globRootImportPath, fd.fieldType, globLibRootURLs); lib != "" {
  			ip[lib] = struct{}{}
  		}
  	}
  	return commons.MapToSortedStrings(ip)
  }
docs: // Imports returns all packages that
  // need to be imported by this struct