You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hit_stats.go
    path of file: ./repos/goatcounter
    
    the code of the file until where you have to start completion: // Copyright © Martin Tournoij – This file is part of GoatCounter and published
// under the terms of a slightly modified EUPL v1.2 license, which can be fo
    
func (h *HitStats) ListSize(ctx context.Context, id string, rng ztime.Range, pathFilter []int64, limit, offset int) error {
	var (
		min_size, max_size int
		empty              bool
	)
	switch id {
	case sizePhones:
		max_size = 384
	case sizeLargePhones:
		min_size, max_size = 384, 1024
	case sizeTablets:
		min_size, max_size = 1024, 1440
	case sizeDesktop:
		min_size, max_size = 1440, 1920
	case sizeDesktopHD:
		min_size, max_size = 1920, 99999
	case sizeUnknown:
		empty = true
	default:
		return errors.Errorf("HitStats.ListSizes: invalid value for name: %#v", id)
	}

	user := MustGetUser(ctx)
	err := zdb.Select(ctx, &h.Stats, "load:hit_stats.ListSize", zdb.P{
		"site":     MustGetSite(ctx).ID,
		"start":    asUTCDate(user, rng.Start),
		"end":      asUTCDate(user, rng.End),
		"filter":   pathFilter,
		"min_size": min_size,
		"max_size": max_size,
		"empty":    empty,
		"limit":    limit + 1,
		"offset":   offset,
	})
	if err != nil {
		return errors.Wrap(err, "HitStats.ListSize")
	}
	if len(h.Stats) > limit {
		h.More = true
		h.Stats = h.Stats[:len(h.Stats)-1]
	}
	for i := range h.Stats { // TODO: see if we can do this in SQL.
		h.Stats[i].Name = strings.ReplaceAll(h.Stats[i].Name, "↔", "↔\ufe0e")
	}
	return nil
}