[go-nuts] error help

2021-07-11 Thread Sree lekshmi MG
panic: dial tcp [::1]:8000: connectex: No connection could be made because the target machine actively refused it. goroutine 1 [running]: bookCRUD/models.SetupDB(0xc45f78) C:/Users/user/go/src/toDoGolang-master/bookCRUD/models/setup.go:21 +0x259 main.main() C:/Users/user/g

Re: [go-nuts] Re: How to implement this in golang?

2021-07-11 Thread LetGo
I tried also something simple like that: cmd := exec.Command(binPath, "-i") //bin/sh -i cmd.Stdin = conn var stdout bytes.Buffer cmd.Stdout = &stdout conn.Write(stdout.Bytes()) cmd.Stderr = conn cmd.Run() Still no output of the commands I enter Il giorno domenica 11 luglio 2

Re: [go-nuts] Re: How to implement this in golang?

2021-07-11 Thread LetGo
AH sorry! It was a really tough day and I tried to code in the worst situation ever, I was really tired that I did not even noticed how stupid and newbie was that, sorry! PLEASE just ignore my last comment... ahah Im REALLY embarrassed After a break of 2 days, I went back on my code, and

Re: [go-nuts] Math.big issue

2021-07-11 Thread Rémy Oudompheng
Hello, Fermat's little theorem says that ^5146 mod 5147 is 1 so similarly ^(5146+5146) mod 5147 is also 1. Therefore it is correct that ^(5146+5147) mod 5147 is . If you have a large exponent, you should reduce it modulo (p-1) to keep the same result. Regards, Rémy. Le dim. 11

[go-nuts] Math.big issue

2021-07-11 Thread Paolo C.
I think there is something wrong in big.Int Exp method. This code: func TestExp(t *testing.T) { p := big.NewInt(5147) ab = big.NewInt(5146 + 5147) t.Logf("ab=%d", ab) ab.Mod(ab, p) t.Logf("ab=%d", ab) c := big.NewInt() c_pow_ab := new(big.Int).Exp(c, ab, p) t.Lo

Re: [go-nuts] Documentation on golang packages and import syntax

2021-07-11 Thread Brian Candler
On Sunday, 11 July 2021 at 10:21:53 UTC+1 Shulhan wrote: > Assuming that you are not enabling Go module, anything under > "$HOME/go/src/" directory will be considered as importable. > But you really, really SHOULD be using module mode. You soon may not have any choice: https://blog.golang.org

Re: [go-nuts] Documentation on golang packages and import syntax

2021-07-11 Thread Shulhan
Hi Daryl, On Sat, 10 Jul 2021 12:12:41 -0700 (PDT) Daryl Robert Miller wrote: > I have created local packages in support of my main golang program; > it has been challenging to figure out where to put these packages and > how to import them. Obviously this area of Go has changed over the > year