Re: [go-nuts] Type of function parameter changes

2020-05-16 Thread Amarjeet Anand
Hi Jesse Thanks for the response. Got it. On Sun, May 17, 2020 at 7:52 AM Jesse McNelis wrote: > Hi, > > You can simply do: > > func P(args ...interface{}) { >print("\n", args...) > } > > The problem you encountered was that you were passing the args as a single > argument to print() > >

Re: [go-nuts] Type of function parameter changes

2020-05-16 Thread Jesse McNelis
Hi, You can simply do: func P(args ...interface{}) { print("\n", args...) } The problem you encountered was that you were passing the args as a single argument to print() The 'var args' syntax collects the arguments and puts them in a slice. So args in P() is a []interface{}. You then pass

[go-nuts] Type of function parameter changes

2020-05-16 Thread Amarjeet Anand
Hi Why does the type of a parameter passed to another function changes? For example: func P(args ...interface{}) { print("\n", args) } func print(seperator string, args ...interface{}) { for _, arg := range args { fmt.Println("arg type: ", reflect.TypeOf(arg)) str := ""

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-16 Thread Daniel Martí
I don't generally advocate the use of obfuscation, but you can give this a try if you want: https://github.com/mvdan/garble -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send

Re: [go-nuts] tail -F with cmd.StdoutPipe, tail blocks in write

2020-05-16 Thread 'Michael Stiller' via golang-nuts
>> >> tail is from coreutils 8.25-2ubuntu3~16.04, kernel 4.4.0-1083-aws >> >> It looks like i cannot read lines that way and tail is blocking in write(1, >> ... > > Running "tail -F" never terminates. That's how it works. Your call > to Wait will never complete. Hi Ian, of course you are

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-16 Thread Billy Cui
Hi Jan, Thank you for your reply. I just want to know the technical solution in Golang, did you mean there is no way for this??? I don't want a 100% working solution. Yes I know the reverse engineering can only be prevented by not release any code or program, I just want to make it more

Re: [go-nuts] tail -F with cmd.StdoutPipe, tail blocks in write

2020-05-16 Thread Ian Lance Taylor
On Sat, May 16, 2020 at 4:27 AM 'Michael Stiller' via golang-nuts wrote: > > i try to read tailed lines of a logfile using this approach: > > if env.TailEnabled { >log.Println("setup tail command") >cmd := exec.Command("/usr/bin/tail", "-F", "logfile.log") >log.Println("setup tail

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-16 Thread Jan Mercl
On Sat, May 16, 2020 at 9:11 PM Billy Cui wrote: > I searched all the websites for such a solution, until Go1.2 there was a > buildmode archive, but it did not supported after 1.2, in the mean time, it > really don't have enough source code protected. > > Then I try use buildmode

[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-16 Thread Billy Cui
I searched all the websites for such a solution, until Go1.2 there was a buildmode archive, but it did not supported after 1.2, in the mean time, it really don't have enough source code protected. Then I try use buildmode c-archive/c-shared, of course c-archive is much better, but both of them

[go-nuts] Re: Generating static documentation from godoc

2020-05-16 Thread Tymoteusz Blazejczyk
This can be also achieved using simple *wget *command for that. Example: snippet I have a similar issue with that. I'm using GitLab for my projects and I have decide to create and share with some handy GitLab CI YAML templates for Go projects that will

[go-nuts] tail -F with cmd.StdoutPipe, tail blocks in write

2020-05-16 Thread 'Michael Stiller' via golang-nuts
Hi, i try to read tailed lines of a logfile using this approach: if env.TailEnabled { log.Println("setup tail command") cmd := exec.Command("/usr/bin/tail", "-F", "logfile.log") log.Println("setup tail pipe") tailPipe, err := cmd.StdoutPipe() if err != nil {