Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 953 Bytes

README.md

File metadata and controls

39 lines (25 loc) · 953 Bytes

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
    })
 }