-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Go implementation #198
Comments
Another solution would be to rename all the templates to |
Why not Or |
I am not sure what you mean. Do you mean to perform the The problem is that because the template is |
Inside a "publish-go" script inside
|
Ah, I see what you mean. The problem is that Go packages are not published to a central repository or anything. Installing the package using I think it's possible to add a "pseudo" |
Why not use a branch instead?
Would it work if we had a clean go-branch that was only updated by the «
publish-go » script ?
Le ven. 11 oct. 2019 à 10:48, Francis Chuang <[email protected]> a
écrit :
Ah, I see what you mean. The problem is that Go packages are not published
to a central repository or anything. Installing the package using go get
will clone github.com/FGRibreau/mailchecker directly into the $GOPATH
directory on the machine.
I think it's possible to add a "pseudo" publish-go command to move the
generated file to another directory, but the filepath would be very
unidiomatic go. The current import path as per #199
<#199> is
github.com/FGRibreau/mailchecker/platform/go. We could possibly move the
final mail_checker.go file into
github.com/FGRibreau/mailchecker/platform/go/lib, but it's not very nice
and not very go-like.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#198?email_source=notifications&email_token=AABBWQV7VRWMUWBREHKCCPDQOA4XFA5CNFSM4I4IHT3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA7KLFQ#issuecomment-540976534>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBWQQ4FKPRCBNCLPRYWALQOA4XFANCNFSM4I4IHT3A>
.
--
Sent from my iPhone
|
Branches are like versions/tags in Go modules. So, if we were to put the generated |
Why not create a new branch called « go-vX.X.X » at each release
(publish-go)? It will work right?
Le dim. 13 oct. 2019 à 05:45, Francis Chuang <[email protected]> a
écrit :
Branches are like versions/tags in Go modules. So, if we were to put the
generated mail_checker.go file into the go-script, the module system
wouldn't work properly. This is because when importing a dependency in go,
we can specify a tag using go get ***@***.***
or a branch using go get ***@***.*** If
the code is now in a branch, we lose the ability to import different
versions or use versioning at all.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#198?email_source=notifications&email_token=AABBWQTARAKX7F63FA3TYSDQOKKWJA5CNFSM4I4IHT3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCNU3Y#issuecomment-541383279>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBWQSZO3Y3HBPUATPXQATQOKKWJANCNFSM4I4IHT3A>
.
--
Sent from my iPhone
|
That will work, but it won't work well with the |
@F21 would go.mod be a solution https://github.com/golang/go/wiki/Modules#gomod ? I've never experienced it, but a go.mod in the root folder could do the trick right? |
There's a I think the root of the problem is that we have |
Ok then, you can submit a PR to both support See this line: https://github.com/FGRibreau/mailchecker/blob/master/lib/generator.js#L23 |
That should work 👍 . I'll have a look through the generator code and open a PR for it. |
Released in v3.3.0! |
I am currently working on a Go implementation in my fork and most of the code and tests are done.
The problem I am facing is how the code for each language implementation is generated from a template. For example, in the Go implementation, we would have
mail_check.tmpl.go
which generatedmail_check.go
under theplatforms/go
directory.The problem with this is that Go automatically looks at all
.go
files in a directory and considers them to be a package. In this case, attempts to use the Go implementation would fail since it will see 2 sets of the same functions implemented in the package as well as invalid syntax due to the mustache placeholders.Go does allow the use of build tags such as
// +build ignore
to ignore a file during the compilation of binaries, but there isn't a way to get this to work because if we include the build tag in themail_check.tmpl.go
file, it will be copied over to themail_check.go
file, which means the library will never build.I think one solution is to add an exception for Go to
generator.js
file, but it obviously won't be a very nice solution as we are introducing these exceptions.The text was updated successfully, but these errors were encountered: