[go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread Tamás Gulácsi
I bet requests (and curl) encodes the params as multipart/form-data, NOT query string. Do the same: https://play.golang.org/p/L4YryKNjju4 remb...@gmail.com a következőt írta (2020. szeptember 19., szombat, 20:44:54 UTC+2): > I am trying to call a simple api by using golang. But, each time it

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
func clearCurrentLine(){ fmt.Print("\n\033[1A\033[K") } [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owk7j) [owk7j] On September 19, 2020 at 20:04 GMT, Joop Kiefte wrote: package main import "fmt" func main() { fmt.Println("Test 1")

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
package main import "fmt" func main() { fmt.Println("Test 1") fmt.Println("Test 2") fmt.Print("\033[1A\033[K") //one up, remove line (should work after the newline of the Println) } Maybe this piece of code helps you? [Joop Kiefte - Chat @

Re: [go-nuts] hook into os.Stdout / os.Stderr

2020-09-19 Thread Raffaele Sena
You can create your own writer and overwrite os.Stdout/Stderr (just supply your own write method with the appropriate before/after hooks) Sent from my iPhone > On Sep 19, 2020, at 12:38 PM, Alexander Mills > wrote: > > Forgive me for this pigeon code, I am looking to do something like: > >

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Alexander Mills
Yeah sure so it looks like: clearCurrentLine() // clears the previous status line fmt.Println("foo") writeStatusLine() // writes new status line where clearCurrentLine() is just like func clearCurrentLine(){ //fmt.Printf("\033[0;") // clear current line //fmt.Printf("\033[2K\r%d",0);

[go-nuts] hook into os.Stdout / os.Stderr

2020-09-19 Thread Alexander Mills
Forgive me for this pigeon code, I am looking to do something like: os.Stdout.BeforeWrite(func (){ }); os.Stderr.AfterWrite(func(){ }) so I can hook into the system and clear the terminal before hand, and write a status line, after wards. Is this possible? -- You received this message

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
Can you give some example code? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owiru) [owiru] On September 19, 2020 at 19:29 GMT, Alex Mills wrote: Yeah I tried all those ANSI codes, nothing seems to work :( On Sat, Sep 19, 2020 at 11:59 AM Joop

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Alex Mills
Yeah I tried all those ANSI codes, nothing seems to work :( On Sat, Sep 19, 2020 at 11:59 AM Joop Kiefte wrote: > I tend to do that with ANSI terminal codes, there are pages that explain > all codes > > *Joop Kiefte* - Chat @ Spike >

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
I tend to do that with ANSI terminal codes, there are pages that explain all codes [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owh4j) [owh4j] On September 19, 2020 at 18:44 GMT, Alex Mills wrote: Using Node.js with several projects I can use

[go-nuts] How to clear current line in terminal

2020-09-19 Thread Alex Mills
Using Node.js with several projects I can use these: const rl = require('readline'); process.stdout.write('current line') rl.clearLine(process.stdout); rl.cursorTo(process.stdout, 0); this will clear the current line in the terminal, so I can achieve something like a status line, but I cannot

[go-nuts] Get request send me hmtl content but works fine from python and curl

2020-09-19 Thread ryan embgrets
I am trying to call a simple api by using golang. But, each time it sends me html content of login page instead of actual data. But same get request works from python and curl. package main import ( "fmt" "io/ioutil" "net/http" "os" ) func main() { client := {} req, err :=

Re: [go-nuts] What are the best practices for go build tools?

2020-09-19 Thread cpu...@gmail.com
Hi Paul! Thank you for taking the time to reply. On Friday, September 18, 2020 at 11:33:49 AM UTC+2 Paul Jolly wrote: > Hi Andi, > > > 1) I cannot do go install tools.go: > > go install takes main packages as arguments, so no, this will not > work. The tools.go file (like the example you