Skip to content

move workspace out of goworld directory#82

Draft
eidng8 wants to merge 24 commits into
xiaonanln:masterfrom
eidng8:master
Draft

move workspace out of goworld directory#82
eidng8 wants to merge 24 commits into
xiaonanln:masterfrom
eidng8:master

Conversation

@eidng8

@eidng8 eidng8 commented Dec 14, 2019

Copy link
Copy Markdown

This PR serves as an early preview, and fire up the talk about the subject.

Currently all documentations and the goworld build tool suggest working directly inside the goworld repo directory. I've started to modifying the build tool to support Go work flow and directory structure.

So far I have modify the build process to follow go module rules. It now supports building projects outside of the goworld directory. Further, I can make customization possible to gate, dispatcher, and game. Making them all can live outside of goworld directory. So it'll be possible for others to just use this package as a dependency, and customize the actual work flow as they want.

However, as the imports are hard-linked to the original repo, I have no way of further testing the whole process. I've tried copying the chat demo from examples directory. Place it in various directories, inside and outside of GOPATH. It seems the building process goes fine. Until I actually add the go.mod file to the demo. Which rquires the v0.1.6 version of the original goworld. And that version doesn't work well with redis cluster v1. I've tried switching to a commit from master with no success.

Please share your thoughts regarding my approach. More importantly, do you think it's necessary to make this package usable as pure dependency, instead of working directly inside it?

Comment thread goworld.ini.sample

[deployment]
desired_dispatchers=1
desired_dispatchers=2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kindly suggestion: do not involve unrelated change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't give this specific line much thought. It's just there are more than one dispatchers in the sample. And it doesn't seem like affecting much on dev phases by increasing on the count. You can reject this if you don't like it.

From my point of view, the sample config should be verbose about more than one dispatcher. And since all actual run time config were created by copying this sample file. It would be a good choice to default the count of dispatchers to at least 2.

Comment thread .gitignore
.idea.bak/
.vscode/
tests/
/goworld.ini

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this file?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is constantly edited across different projects. However, it's content can be reproduced directly by copying from the goworld.ini.sample. Removing it from the source file prevents others from accidentally committing non-relevant change, or worse, breaking others' project.
I've adding process to the build script, specifically handling creation of the goworld.ini from sample, and placing it to the bin folder. So most people won't even notice it.

Comment thread cmd/goworld/build.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants