3 // Copyright 2023 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
15 m := map[string]struct{}{}
17 // Fill m up to the max for 4 buckets = 48 entries.
18 for i := 0; i < 48; i++ {
19 m[fmt.Sprintf("%d", i)] = struct{}{}
22 // Add a 49th entry, to start a grow to 8 buckets.
25 // Remove that 49th entry. m is still growing to 8 buckets,
26 // but a clone of m will only have 4 buckets because it
27 // only needs to fit 48 entries.
30 // Clone an 8-bucket map to a 4-bucket map.