Skip to content

sreis/gotemplates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotemplates

Go template repository to use with go template tool.

GoDoc

Install

go get -u github.com/ncw/gotemplate
go get -u github.com/sreis/gotemplates

Provides

  • Concurrent Map implementation in package concurrentmap

Example

Create a file mapstringint.go with:

package main

//go:generate gotemplate "github.com/sreis/gotemplates/concurrentmap" "MapStringInt(string, int)"

And use the new MapStringInt like so:

package main

import "fmt"

func main() {
    cmap := NewMapStringInt()
    key := "foobar"
    value := 1337
    cmap.Set(key, value)
    v, ok :=  cmap.Get(key)
    fmt.Println("value ", v, ok)
}

Build with:

make

About

Go template repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages