INNER CODE UNIT · Go

swaggify

openkruise/kruise · hack/gen-openapi-spec/main.go:91

func swaggify(name string) string {
	name = strings.Replace(name, "github.com/openkruise/kruise/apis", "kruise", -1)
	parts := strings.Split(name, "/")
	hostParts := strings.Split(parts[0], ".")
	// reverses something like k8s.io to io.k8s
	for i, j := 0, len(hostParts)-1; i < j; i, j = i+1, j-1 {
		hostParts[i], hostParts[j] = hostParts[j], hostParts[i]
	}
	parts[0] = strings.Join(hostParts, ".")
	return strings.Join(parts, ".")
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…