private static void generateFieldMetaAttributeMethod(
        final StringBuilder sb, final Token token, final String indent, final String className)
    {
        final Encoding encoding = token.encoding();
        final String propertyName = toUpperFirstChar(token.name());
        final String epoch = encoding.epoch() == null ? "" : encoding.epoch();
        final String timeUnit = encoding.timeUnit() == null ? "" : encoding.timeUnit();
        final String semanticType = encoding.semanticType() == null ? "" : encoding.semanticType();

        sb.append("\n")
            .append(indent).append("func (m *").append(className)
            .append(") ").append(propertyName).append("MetaAttribute(metaAttribute string) string {\n")
            .append(indent).append("    switch metaAttribute {\n");

        if (!Strings.isEmpty(epoch))
        {
            sb.append(indent)
                .append("        case \"EPOCH\": return \"").append(epoch).append("\"\n");
        }

        if (!Strings.isEmpty(timeUnit))
        {
            sb.append(indent)
                .append("        case \"TIME_UNIT\": return \"").append(timeUnit).append("\"\n");
        }

        if (!Strings.isEmpty(semanticType))
        {
            sb.append(indent)
                .append("        case \"SEMANTIC_TYPE\": return \"").append(semanticType)
                .append("\"\n");
        }

        sb
            .append(indent).append("        case \"PRESENCE\": return \"")
            .append(encoding.presence().toString().toLowerCase()).append("\"\n")
            .append(indent).append("        default: return \"\"\n")
            .append(indent).append("    }\n")
            .append(indent).append("}\n");
    }
Create a new Golang language {@link CodeGenerator}.

@param ir                            for the messages and types.
@param shouldDecodeUnknownEnumValues generate support for unknown enum values when decoding.
@param outputManager                 for generating the codecs to.
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/flyweight/GolangFlyweightGenerator.java