code: func getContext(inputFile, outputDir string) (*context, error) {
  	if !strings.HasSuffix(inputFile, inputFileExt) {
  		return nil, fmt.Errorf("invalid input file name: %q", inputFile)
  	}
  
  	ctx := &context{
  		inputFile: inputFile,
  	}
  
  	// package name
  	inputFileName := filepath.Base(inputFile)
  	ctx.moduleName = inputFileName[:strings.Index(inputFileName, ".")]
  
  	// alter package names for modules that are reserved keywords in Go
  	switch ctx.moduleName {
  	case "interface":
  		ctx.packageName = "interfaces"
  	case "map":
  		ctx.packageName = "maps"
  	default:
  		ctx.packageName = ctx.moduleName
  	}
  
  	// output file
  	packageDir := filepath.Join(outputDir, ctx.packageName)
  	outputFileName := ctx.packageName + outputFileExt
  	ctx.outputFile = filepath.Join(packageDir, outputFileName)
  
  	return ctx, nil
  }
docs: // getContext returns context details of the code generation task