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: index.go
    path of file: ./repos/erda/internal/tools/monitor/extensions/loghub/sls-import
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License
    
func (p *provider) loadIndices() ([]*indexEntry, error) {
	ctx, cancel := context.WithTimeout(context.Background(), p.C.Output.Elasticsearch.RequestTimeout)
	defer cancel()
	resps, err := p.es.CatIndices().Index(p.C.Output.Elasticsearch.IndexPrefix + "*").Columns("index").Do(ctx)
	if err != nil {
		return nil, err
	}
	var indices []*indexEntry
	for _, item := range resps {
		parts := strings.Split(item.Index, "-")
		if len(parts) != 3 {
			p.L.Debugf("invalid index format %s", item.Index)
			continue
		}
		last := len(parts) - 1
		timestamp, err := strconv.ParseInt(parts[last], 10, 64)
		if err != nil {
			p.L.Warnf("invalid timestamp in index %s, %s", item.Index, err)
			continue
		}
		ts := time.Unix(timestamp/1000, (timestamp%1000)*int64(time.Millisecond))
		indices = append(indices, &indexEntry{
			Index:     item.Index,
			Timestamp: ts,
		})
	}
	return indices, nil
}