func ParseComments()

in pkg/converter/comments.go [20:38]


func ParseComments(fd *descriptor.FileDescriptorProto) Comments {
	comments := make(Comments)

	for _, loc := range fd.GetSourceCodeInfo().GetLocation() {
		if !hasComment(loc) {
			continue
		}

		path := loc.GetPath()
		key := make([]string, len(path))
		for idx, p := range path {
			key[idx] = strconv.FormatInt(int64(p), 10)
		}

		comments[strings.Join(key, ".")] = buildComment(loc)
	}

	return comments
}