Merge pull request #355 from testwill/strings

unconditional use strings.TrimSuffix
This commit is contained in:
Randall O'Reilly 2024-12-06 10:50:20 -08:00 committed by GitHub
commit 5f285b8900
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 6 deletions

View File

@ -198,12 +198,8 @@ else:
fmt.Printf("no LibPy -- set to: %s\n", raw.LibPy)
}
if strings.HasSuffix(raw.LibPy, ".a") {
raw.LibPy = raw.LibPy[:len(raw.LibPy)-len(".a")]
}
if strings.HasPrefix(raw.LibPy, "lib") {
raw.LibPy = raw.LibPy[len("lib"):]
}
raw.LibPy = strings.TrimSuffix(raw.LibPy, ".a")
raw.LibPy = strings.TrimPrefix(raw.LibPy, "lib")
cfg.Version = raw.Version
cfg.ExtSuffix = raw.ExtSuffix