Skip to content
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

Refactor common elements from modules into a common module #11

Open
ryankurte opened this issue Apr 23, 2017 · 2 comments
Open

Refactor common elements from modules into a common module #11

ryankurte opened this issue Apr 23, 2017 · 2 comments

Comments

@ryankurte
Copy link
Owner

Some common identifiers and types are sneaking in across modules, probably time to have a look at what can be refactored out and shared across modules to avoid redefinitions.

@thearavind
Copy link
Contributor

Can we create a separate package for the types and import them and reuse it in all other modules, Will this work???

@ryankurte
Copy link
Owner Author

Possibly yep, but it only makes sense to extract types that are shared between modules I think.
It's also kinda neat that each module has all the required types internally, and extracting them might make usage less clear :-/

import (
    "gopkg.in/ryankurte/go-mapbox.v0/lib/maps"
)

img, err := mapBox.Maps.GetTiles(maps.MapIDSatellite, 1, 0, 0, maps.MapFormatJpg90, true)

Could end up being:

import (
    "gopkg.in/ryankurte/go-mapbox.v0/lib/common"
    "gopkg.in/ryankurte/go-mapbox.v0/lib/maps"
)

img, err := mapBox.Maps.GetTiles(common.MapIDSatellite, 1, 0, 0, common.MapFormatJpg90, true)

So maybe this needs some more thinking about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants