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: utils.go
    path of file: ./repos/client/go/emails
    
    the code of the file until where you have to start completion: package emails

import (
	"context"
	"net/mail"
	"strings"

	"github.com/keybase/client/go/externals"
	"github.com/keybase/client/go/libkb"
)

// splitBulk splits on newline or comma.
func splitBulk(s string) []string {
	f := func(c rune) bool {
		return c == '\n' || c == ','
	}
	split := strings.FieldsFunc(s, f)
	for i, s := range split {
		split[i] = strings.TrimSpace(s)
	}
	return split
}

// ParseSeparatedEmails parses a comma-or-new-line-separated email list that
// comes in a string. It can extract emails that conform to RFC 5322 and RFC
// 6532 (see net/mail documentation for more info).
//
// Examples of a valid e-mail entities would be:
// - Jan Smith <jan@example.com>
// - alice@example.org
//
// The "name" portion is ignored, caller will always get the raw e-mails, in
// this case: { "jan
    
func ParseSeparatedEmails(mctx libkb.MetaContext, emails string, malformed *[]string) (ret []string) {
	emailList := splitBulk(emails)
	mctx.Debug("ParseSeparatedEmails: bulk email invite count: %d", len(emailList))
	for _, email := range emailList {
		addr, parseErr := mail.ParseAddress(email)
		if parseErr != nil {
			mctx.Debug("ParseSeparatedEmails: skipping malformed email %q: %s", email, parseErr)
			if malformed != nil {
				*malformed = append(*malformed, email)
			}
			continue
		}

		// API server side of this only accepts x.yy domain name:
		parts := strings.Split(addr.Address, ".")
		if len(parts[len(parts)-1]) < 2 {
			mctx.Debug("ParseSeparatedEmails: skipping malformed email (domain) %q", email)
			if malformed != nil {
				*malformed = append(*malformed, email)
			}
			continue
		}

		ret = append(ret, addr.Address)
	}
	return ret
}