[go-nuts] Re: How to work with multiple environment like dev, test, staging, prod in golang ?

2020-05-17 Thread Amnon Baron Cohen
My advice is to use the same application-dev.yml, application-test.yml, application-prod.yml YAML files that you are familiar with, and have your application read its config from them. Changing language does not mean that you have to change the way you configure your application. On

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread robert engels
Just distribute it as a plugin (https://golang.org/pkg/plugin/ ) - you only need to make the calling interface public - and based on your use case - there is nothing proprietary there so it won’t be a problem. > On May 17, 2020, at 9:45 PM, Billy Cui wrote: >

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread Billy Cui
Hi Daniel, I have test your solution of obfuscation, look you can only obfuscate the binary not the source code. In my case, I need to obfuscate the library code, it's not final binary, it should be called by 3rd party. On Sunday, May 17, 2020 at 6:11:18 AM UTC+8, Daniel Martí wrote: > > I

[go-nuts] Re: Variadic Arguments and Interfaces

2020-05-17 Thread Saied Seghatoleslami
I found this article by Nick Gauthier from 2016. https://www.meetspaceapp.com/2016/05/23/writing-a-data-mapper-in-go-without-an-orm.html. The original idea is contributed to Martin Fowler. Someone else has solved this problem before. On Friday, September 7, 2012 at 4:45:07 PM UTC-4, Paddy

Re: [go-nuts] Re: Variadic Arguments and Interfaces

2020-05-17 Thread Saied Seghatoleslami
I have it working well by listing the individual conditions. But I have a bunch of functions that do similar things (authenticate a user based on their email and password, get a list of users based on role and active status, get an individual user based on ID, etc.) and I was looking to

Re: [go-nuts] Re: Variadic Arguments and Interfaces

2020-05-17 Thread Steven Hartland
Did you use the correct calling convension e.g. db.Query(query, cond...) The ... makes the slice variadic, passing echData.Active, exchData.Role instead of just a interface slice On 17/05/2020 23:27, Saied Seghatoleslami wrote: I hate to dig up something from 2012, but I have come across a

[go-nuts] Re: Variadic Arguments and Interfaces

2020-05-17 Thread Saied Seghatoleslami
I hate to dig up something from 2012, but I have come across a similar issue where I can use an explanation. The signature of the Query function in the sql package is: func (db *DB ) Query(query string , args

Re: [go-nuts] How to work with multiple environment like dev, test, staging, prod in golang ?

2020-05-17 Thread robert engels
SpringBoot is a framework. How it handles this is different from every other framework. Easiest way in Go, just name your configuration files similar to filename.mode.yaml where mode is prod, dev, qa, etc. and set a env variable for the mode. You can then take it from there, and have base

[go-nuts] Re: How to work with multiple environment like dev, test, staging, prod in golang ?

2020-05-17 Thread Volker Dobler
Go, the language and the std tooling has no predefined way of doing this. Do whatever fits your need. V. On Sunday, 17 May 2020 19:19:23 UTC+2, Shishira Pradhan wrote: > > Hi All, > > i'm a java developer, currently working on golang. In springboot, we have > configuration like port, database

[go-nuts] How to work with multiple environment like dev, test, staging, prod in golang ?

2020-05-17 Thread Shishira Pradhan
Hi All, i'm a java developer, currently working on golang. In springboot, we have configuration like port, database etc info are stored in yaml files like application-dev.yml, application-test.yml, application-prod.yml profiles, and profile name is passed during running the application to

[go-nuts] How to use ftp.walk in goftp

2020-05-17 Thread Nikhil Bhavsar
Hi , I have to download files to local from remote using ftp please suggest me if you have another option. // Download each file into local memory, and calculate it's sha256 hash err = ftp.Walk("/", func(path string, info os.FileMode, err error) error { _, err = ftp.Retr(path,

[go-nuts] Re: Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread Billy Cui
Hi Pat, For network usage, you can do that, but there is too many library don't rely on network. BTW, the obfuscation is not silly, the excellent languages such Java, Javascript and many more have this feature. Actually I wonder why not Golang native support this:) On Monday, May 18, 2020

[go-nuts] Re: Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread Pat Farrell
Write your code as a service, run it on a cloud service and have the customers just use normal HTTP(s) You will regret any silly obfuscation approach -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-17 Thread Billy Cui
Hi Daniel, I'll try, thank you very much, I did already think of the obfuscation solution, and also found another one: https://github.com/unixpickle/gobfuscate Maybe you can make a comparison for that one and yours. I think a good competition should be a great thing for both. On Sunday, May