subfinder / research

❄️ Research project for SubFinder core API V2
MIT License
35 stars 8 forks source link

add core API style guide #49

Open picatz opened 6 years ago

picatz commented 6 years ago

@Mzack9999 and I had a really great conversation about creating a "style guide" for the core API.

Note: Nothing is finalized yet, but I think it would be really great to help new developers join working on the code base when they know what they are expected to do. Creating documentation can help ease in new developers by having resources they can rely on.

Example

If I am making a new source, should I create a newSource() function that returns a *Source or do you just call &Source{}? Currently, I've been enforcing the more direct call to &Source{} which reduces the needed boilerplate to write a new source and directly uses Go's own initialization patterns instead of having a more traditional object orientated pattern with an explicit initializer function.

Examples and explanations can/should be curated to cultivate a unified style other developers can use.

picatz commented 5 years ago

Some work has been done on this in the README for sources: https://github.com/subfinder/research/blob/master/core/sources/README.md

picatz commented 5 years ago

This docs will need to be updated once https://github.com/subfinder/research/pull/59 is merged into master.