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: describe.go
    path of file: ./repos/cockroach/pkg/cli/clisqlshell
    
    the code of the file until where you have to start completion: // Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package clisqlshell

import (
	"fmt"
	"regexp"
	"strings"

	"github.com/cockroachdb/cockroach/pkg/sql/lexbase"
	"github.com/cockroachdb/errors"
)

var fnDescribeCmdRe = regexp.MustCompile(`^df[anptw]*$`)
var tbDescribeCmdRe = regexp.MustCompile(`^d[tivmsE]*$`)

// d
    
func describeRoles(hasPattern bool, verbose, showSystem bool) (string, string) {
	var buf strings.Builder

	buf.WriteString(`WITH roles AS (
SELECT r.rolname, r.rolsuper, r.rolinherit,
       r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,
       r.rolconnlimit, r.rolvaliduntil,
       ARRAY(SELECT b.rolname
             FROM pg_catalog.pg_auth_members m
             JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid)
             WHERE m.member = r.oid) as memberof`)

	if verbose {
		buf.WriteString(`,
       pg_catalog.shobj_description(r.oid, 'pg_authid') AS description`)
	}

	buf.WriteString(`,
       r.rolreplication, r.rolbypassrls
  FROM pg_catalog.pg_roles r`)

	if !showSystem && !hasPattern {
		buf.WriteString(`
 WHERE r.rolname !~ '^pg_'`)
	} else if hasPattern {
		buf.WriteString(`
 WHERE r.rolname LIKE %[1]s`)
	}

	// Presentation.
	buf.WriteString(`)
SELECT rolname AS "Role name",
       array_to_string(ARRAY(
         SELECT a FROM (VALUES
          (IF(rolsuper,        'Superuser', NULL)),
          (IF(NOT rolinherit,  'No inheritance', NULL)),
          (IF(rolcreaterole,   'Create role', NULL)),
          (IF(rolcreatedb,     'Create DB', NULL)),
          (IF(NOT rolcanlogin, 'Cannot login', NULL)),
          (IF(rolconnlimit = 0,
              'No connections',
              IF(rolconnlimit > 0,
                 rolconnlimit::STRING || ' connection' || IF(rolconnlimit>1, 's',''),
                 NULL))),
          (IF(rolreplication,  'Replication', NULL)),
          (IF(rolbypassrls,    'Bypass RLS', NULL)),
          ('Password valid until ' || rolvaliduntil)
         ) AS v(a) WHERE v.a IS NOT NULL),
         ', ') AS "Attributes",
       memberof AS "Member of"`)

	if verbose {
		buf.WriteString(`,
       COALESCE(description, '') AS "Description"`)
	}

	buf.WriteString(`
  FROM roles`)
	return "List of roles", buf.String()
}