Skip to content

Please provide example code. #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WizzerWorks opened this issue Jun 7, 2019 · 1 comment
Closed

Please provide example code. #9

WizzerWorks opened this issue Jun 7, 2019 · 1 comment

Comments

@WizzerWorks
Copy link

Your readme states that you provide "generic types to allow the user to swap out various data structures transparently. The interfaces provide operation for adding, removing, retrieving objects from collections as well as iterating over the collection using functional iterators."

How does this work? For example:

var myKey int16 = 1
table := NewHashTable(10)
var key types.Int16
// XXX: key = myKey
var value interface{} = myData
var err error
value, err = table.Put(key, value)

I don't understand how to assign myKey to the types.Int16 key.

Thank you.

@timtadh
Copy link
Owner

timtadh commented Jun 8, 2019

k := types.Int16(1)
k2 := int16(12)
k3 := types.Int16(k2)

@timtadh timtadh closed this as completed Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants