8000 GitHub - go-dash/_gen: Command line tool for code generation of Godash library implementations · GitHub
[go: up one dir, main page]

Skip to content
go-dashPublic

About

Command line tool for code generation of Godash library implementations

Resources

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

_gen Code Generator

This command line tool is part of Godash - an efficient Lodash port for golang. Since golang doesn't currently support generics, the closest workaround is to work with code generation. The _gen command line tool generates code based on your project requirements and adds it to the go-dash/slice library.

Installation

brew install go-dash/tools/gen

Verify the installation by running _gen --version.

Usage

  1. Write your project code normally according to the instructions in the go-dash/slices library.

  2. Using terminal, open your project root and run the command line tool once by typing _gen.

  3. That's it, the new code for the types you need will appear in $GOPATH/src/github.com/go-dash/slice.

How it works

The tool first analyzes your source code and looks for imports of the format:

"github.com/go-dash/slice/_TYPE"

For example:

import "github.com/go-dash/slice/_string"
import "github.com/go-dash/slice/_int"
import "github.com/go-dash/slice/_Person"

It then generates new subsets of the library for your specific types. The generated code will be placed in:

$GOPATH/src/github.com/go-dash/slice/_string
$GOPATH/src/github.com/go-dash/slice/_int
$GOPATH/src/github.com/go-dash/slice/_Person

License

MIT

Who made this

Godash is developed by the Orbs.com engineering team. Orbs is a public blockchain infrastructure for decentralized consumer applications with millions of users. Orbs core has an open source implementation in golang.

About

Command line tool for code generation of Godash library impleme 50D0 ntations

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0