go-generics

module
v0.0.2-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2024 License: MIT

README

Go - Generics

Go Reference

Go Generics provides a library of basic tooling focused around generics. Generally, this revolves around typing and data structures.

package main

import (
	"fmt"

	"git.sr.ht/~fungus/go-generics/slices"
)

func main() {
	s := []int{1, 2, 3, 4}
	fmt.Printf("%v\n", s)
	// [1 2 3 4]

	s = slices.Map(s, func(i int) int { return i*2 })
	fmt.Printf("%v\n", s)
	// [2 4 6 8]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL