(format string)
| 817 | } |
| 818 | |
| 819 | func parseMessageEncoding(format string) (MessageEncoding, error) { |
| 820 | switch format { |
| 821 | case formatBin, formatBinpb, formatBingz: |
| 822 | return MessageEncodingBinpb, nil |
| 823 | case formatJSON, formatJSONGZ: |
| 824 | return MessageEncodingJSON, nil |
| 825 | case formatTxtpb: |
| 826 | return MessageEncodingTxtpb, nil |
| 827 | case formatYAML: |
| 828 | return MessageEncodingYAML, nil |
| 829 | default: |
| 830 | return 0, fmt.Errorf("invalid format for message: %q", format) |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | // TODO FUTURE: this is a terrible heuristic, and we shouldn't be using what amounts |
| 835 | // to heuristics here (technically this is a documentable rule, but still) |
no outgoing calls
no test coverage detected
searching dependent graphs…