implement trimSuffix for older go