pgweb/pkg/client/util.go
2018-06-05 15:48:16 -05:00

16 lines
267 B
Go

package client
import (
"strings"
)
// Get short version from the string
// Example: 10.2.3.1 -> 10.2
func getMajorMinorVersion(str string) string {
chunks := strings.Split(str, ".")
if len(chunks) == 0 {
return str
}
return strings.Join(chunks[0:2], ".")
}