Skip to content

Type-Safe Golang Generics Struct Based on Standard Library

License

Notifications You must be signed in to change notification settings

quentinlesceller/generics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generics

.github/workflows/ci.yaml Go Reference

Package generics contains type-safe golang struct based on standard library struct.

Usage

SyncMap

package main

import (
    "fmt"

    "github.com/quentinlesceller/generics"
)

func main() {
    // Instantiate a new SyncMap
    var m generics.SyncMap[string, int32]

    // Store some data
    m.Store("hello", 1)
    m.Store("world", 2)

    // Range over it
    m.Range(func(k string, v int32) bool {
        fmt.Println(k, v)
        return true
    })
 }

About

Type-Safe Golang Generics Struct Based on Standard Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages