File: ext.go

package info (click to toggle)
golang-honnef-go-tools 2023.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,784 kB
  • sloc: sh: 132; xml: 48; lisp: 30; makefile: 10; javascript: 1
file content (18 lines) | stat: -rw-r--r-- 378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package typeutil

import (
	"fmt"
	"go/types"
)

type Iterator struct {
	elem types.Type
}

func (t *Iterator) Underlying() types.Type { return t }
func (t *Iterator) String() string         { return fmt.Sprintf("iterator(%s)", t.elem) }
func (t *Iterator) Elem() types.Type       { return t.elem }

func NewIterator(elem types.Type) *Iterator {
	return &Iterator{elem: elem}
}