// SampleIndexByName returns the appropriate index for a value of sample index. // If numeric, it returns the number, otherwise it looks up the text in the // profile sample types. func (p *Profile) SampleIndexByName(sampleIndex string) (int, error) { … } func sampleTypes(p *Profile) []string { … }