mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
- Simplify joinMax using strings.Join - Fix rolePolicies: remove s3:ListBucket from object-level actions (already covered by bucket-level statement) - Fix admin role: grant s3:* on bucket resource too - Return flag parse errors instead of swallowing them
12 lines
269 B
Go
12 lines
269 B
Go
package shell
|
|
|
|
import "strings"
|
|
|
|
// joinMax joins up to max strings with ", " and appends "..." if truncated.
|
|
func joinMax(items []string, max int) string {
|
|
if len(items) <= max {
|
|
return strings.Join(items, ", ")
|
|
}
|
|
return strings.Join(items[:max], ", ") + "..."
|
|
}
|