Giter Club home page Giter Club logo

go-underscore's Issues

Actively development

Is this library under actively development now?
I am interested in developing and maintaining the library. But just realised that the last commit is 4 years ago.

Make package "go get" compatible

There are two things which prevent this package from being go get compatible and idiomatic. The first can be fixed with a pull request, but the second requires changing the repository name/location.

Go projects use a single directory for all files in a package, and this directory generally has the same name as the package name (so src directories aren't used in Go projects).

However, project names that end in .go are no longer recognized by the entire Go toolchain, which means that the project name should really be underscore (or perhaps __, not `underscore.go).

(I was going to submit a pull request, but then I realized that the respository name ended in .go, which ideally should be fixed before moving the files out of the src directory; doing this in the other order would result in an inconsistent intermediate state.)

go get and import commands

Can you add the proper

go get "github.com..."

and

import "github.com..."

lines to the readme for go noobs like me.

several suggestions

I browsed your code and have some suggestions.

first, I think underscore need a more general function instead of specifying a function for a certain type,for instance in order to map string you need to specify a SMap function pointer.Your code was excellent,could be there any way to implement such general function? such like not returning []interface{},but receive a point of return value as argument,in order to reflect the result.

second, in Each, I think sync.WaitGroup is more comlicated because it is implemented by lock,and why not do like


var done = make(chan struct{}{},m.Len()) //m is the map or slice
for i:= 0;i<s.Len();i++{
    go func(){
        donw <-
    }() 
}

for i:= 0;i<s.Len();i++{
    done <-
}

I thins this dose the same work,but in more Go way.

third, function decleration is not constant,Each has argument name but Map does not which will make some confusion.

fourth chan argument should be more strict ,to spefigy read-only or write-only
reader need argument like job <- chan,which should only read from in the function body.

fifth , jobs in Each should be bufferd capabible of len of workers number,
so that workers will not block on read or write and will be more akin parallel

That's my thoughts,maybe it's wrong or not appropriate,hoping to discuss!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.