File: generic_new_and_make_slice.go

package info (click to toggle)
golang-github-cheekybits-genny 1.0.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 336 kB
  • sloc: makefile: 17; sh: 3
file content (19 lines) | stat: -rw-r--r-- 465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package bugreports

import "github.com/cheekybits/genny/generic"

// NumberType will be replaced in tests
type NumberType generic.Number

// ObjNumberType is the struct used for tests.
type ObjNumberType struct {
	v NumberType
}

// NewNumberTypes calls new on ObjNumberType and instantiates slice.
// Targets github issues #36 and #49
func NewNumberTypes() (*ObjNumberType, []ObjNumberType) {
	n := new(ObjNumberType)
	m := make([]ObjNumberType, 0)
	return n, m
}