Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Go Type-First Development Snippets {{category=go}}

License

Wei-N-Ning/gotypes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Generic Collections

See the objectives page.

Limitation

  • cannot produce a new type parameter in a receiver function (a method)
    • e.g. this won't work: func (iter Iterator[T]) ChunkSlice(size int) Iterator[[]T] ([]T is a new type parameter)
  • type inference sometimes is broken (see the unit tests where I have to add the variable type hint)
  • cannot define type alias inside function (will treat the type parameter as index) - it is not a critical issue but makes the code cumbersome
  • Go doesn't have first class tuple and pair types: Tuple[T...], or Pair[T, P]
  • no variadic type parameter support (or I don't know?)

About

Go Type-First Development Snippets {{category=go}}

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages