[go-nuts] Re: Can write data and sync a removed file

2021-12-08 Thread Brian Candler
As a general request, please don't post screen images. They are very hard to read, especially for (but not exclusively for) those with visual impairment. They also can't be copy-pasted. You haven't said what platform you are running on. However if this is Linux or another POSIX-compatible sys

[go-nuts] Re: Can write data and sync a removed file

2021-12-08 Thread Benjamin
I tested the program on both Linux and Mac, and the behavior is consistent. Makes sense, Looks like an expected behavior. Thanks. Just paste the program as below, package main import ( "fmt" "os" ) func main() { f, err := os.OpenFile("/tmp/db", os.O_RDWR | os.O_CREATE, 0666) if err != nil {

[go-nuts] From interface to []rune

2021-12-08 Thread Денис Мухортов
Can i get data from interface to []rune like that: https://play.golang.com/p/XpXTeUgL-Tn If so, how?? -- 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 an email to golang-nuts+

[go-nuts] json: cannot unmarshal object into Go value of type []main.ConnectwiseTicket

2021-12-08 Thread logan infranca
So I am running my .go file to update things but I keep getting this error. Not completly sure why it could be happening. I debuged it and it seems to be happening here.[image: Capture4.PNG] [image: Capture3.PNG] -- You received this message because you are subscribed to the Google Groups "gol

[go-nuts] Re: json: cannot unmarshal object into Go value of type []main.ConnectwiseTicket

2021-12-08 Thread Tamás Gulácsi
Why on earth does everybody paste screenshots about TEXTs??? Please copy-paste simple text as simple text! Color does not convey information, only hides. Your code is readable, but the error message _is_not_. linfr...@gmail.com a következőt írta (2021. december 8., szerda, 18:21:04 UTC+1): > So

Re: [go-nuts] From interface to []rune

2021-12-08 Thread Marcin Romaszewicz
No, you can't. A string is not a []rune, but it can be type converted to one, so you have to type convert your interface to string, then convert to runes. https://play.golang.com/p/GKITxGGYHZI On Wed, Dec 8, 2021 at 5:44 AM Денис Мухортов wrote: > Can i get data from interface to []rune like th

[go-nuts] Re: json: cannot unmarshal object into Go value of type []main.ConnectwiseTicket

2021-12-08 Thread Brian Candler
In addition: please can you take the problematic piece of code and boil it down to a simple standalone example in play.golang.org^W go.dev/play/ which reproduces the error - for example, with a static constant string that you're trying to decode, and some structs that you're trying to decode int

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-08 Thread jake...@gmail.com
Runs fine for me with one tiny change: https://go.dev/play/p/VRZKDFGzUcG On Tuesday, December 7, 2021 at 7:21:31 PM UTC-5 Rob 'Commander' Pike wrote: > Oh, it needs to be runnable. Never mind. > > -rob > > On Wed, Dec 8, 2021 at 11:19 AM Rob Pike wrote: > > > > It's easy to fold a few things tog

[go-nuts] encoding/gob: doc of encoding of single values is inconsistent

2021-12-08 Thread Jared Zhou
The doc says. https://github.com/golang/go/blob/d6c4583ad4923533ddc9f5792ed3b66f3b9f9feb/src/encoding/gob/doc.go#L178 If a value is passed to Encode and the type is not a struct (or pointer to struct, etc.), for simplicity of processing it is represented as a struct of one field. The only visibl