Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-12 Thread Marvin Renich
* Robert Engels [191112 12:59]: > The bug I referenced discusses the current problem with the MM > specification. You are making assumptions that are not supported by > the current MM, but as the bug points out, that is the current > behavior. I can see that point of view, and I don't think it is

Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-13 Thread Marvin Renich
* burak serdar [191112 12:45]: > Is there a guarantee that the compiler will not reorganize > instructions around an atomic read/write? That is: > > i++ > k:=atomic.AddInt32(&j,1) > > Is there a guarantee that the compiler won't rewrite this as: > > k:=atomic.AddInt32(&j,1) > i++ First, from o

Re: [go-nuts] Re: Understanding go routine heap

2016-08-22 Thread Marvin Renich
* Joubin Houshyar [160822 12:36]: > On Monday, August 22, 2016 at 10:27:06 AM UTC-4, Marvin Renich wrote: > > * Joubin Houshyar > [160822 09:47]: > > > > > > Your firend is correct that using a WaitGroup here does not in anyway > > > address concurrent ac

Re: [go-nuts] Re: dynamic frequency ticker

2016-08-31 Thread Marvin Renich
> > On Tuesday, August 30, 2016 at 8:46:23 PM UTC+3, seb@gmail.com wrote: > >> > >> In my application I select on a ticker channel, but sometimes need to > >> have the waiting time vary a bit. For not so frequent changes I could make > >> a new ticker everytime, but I have the feeling this is

Re: [go-nuts] differences between pointer and value slice in for-range loop

2016-09-17 Thread Marvin Renich
* Fei Ding [160916 23:30]: > Link here: https://play.golang.org/p/cdryPmyWt5 > > The code above is going to check the differences between pointers and > values in a for loop, while go statement is also used at the same time. For > code: > > values := []field{{"one"},{"two"},{"three"}} >

Re: [go-nuts] Re: The site at localhost:1234 can't be reached.

2016-09-17 Thread Marvin Renich
* Dave Cheney [160917 15:58]: > Move http.ListenAndServe to the top of the main() function, outside the > http.HandleFunc call and it will work. Don't you mean bottom? At the top, the ListenAndServe will not return, so the HandleFunc call will never be made, so you will always get 404. ...Marv

Re: [go-nuts] differences between pointer and value slice in for-range loop

2016-09-19 Thread Marvin Renich
* Fei Ding [160918 02:58]: > Thanks, Marvin, I've learned a lot from your reply. And, I've written more > code, like: > > a, b, c := 1, 2, 3 > > slice1 := []int{a, b, c} > > for _, n := range slice1 { > > go func(n *int) {fmt.Println(*n)}(&n) > > } > > > It seems that pass *n's address *in the

Re: [go-nuts] Randomizing contents of a file

2016-09-20 Thread Marvin Renich
* Unknown User [160920 06:43]: > Hi All, > > I am trying to print the contents of a file randomizing the lines. > The following code works, but does not exit even after all the lines are > read. > What needs to be done to correct it? Try this package mai

Re: [go-nuts] Randomizing contents of a file

2016-09-20 Thread Marvin Renich
* Marvin Renich [160920 08:26]: > As a general rule of thumb, use a select only when you have more than > one channel send and/or receive that you want to wait for, and only use ^ different > a default case when you have other work that can be done if the channel > operat

[go-nuts] playground URL to fetch code only

2016-09-20 Thread Marvin Renich
Is there a way to take a playground URL, such as https://play.golang.org/p/Vg6f0gSs3l, and modify it (e.g. with a query string) so that you can retrieve just the code as text without the surrounding html? Something like curl 'https://play.golang.org/p/Vg6f0gSs3l?text' If not, would such a featur

Re: [go-nuts] playground URL to fetch code only

2016-09-20 Thread Marvin Renich
* Nicolas Martyanoff [160920 10:07]: > curl 'https://play.golang.org/p/Vg6f0gSs3l.go', i.e. just appending '.go' will > do the trick. Excellent! Thank you! ...Marvin -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

Re: [go-nuts] Re: playground URL to fetch code only

2016-09-20 Thread Marvin Renich
* Ivan Anfilatov [160920 10:36]: > https://play.golang.org/p/Vg6f0gSs3l.go > > compile - post request to https://play.golang.org/compile in body request - > source > response - json Thanks, Ivan! ...Marvin -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] How to define two identical named types?

2016-10-02 Thread Marvin Renich
* Matt Harden [161001 23:34]: > I do think that T L has a point. The spec defines the syntax of the > language, and TypeSpec refers to a syntactical construct. It is not > possible in the syntax of the language to create two named types that > originate in the same TypeSpec. We seem to be saying t

Re: [go-nuts] exec.Command

2016-10-05 Thread Marvin Renich
* hadiesmail...@gmail.com [161005 05:46]: > hi > > in the second arg in function exec.Command(), what i must put it?? > > and any my question is : > > i want run a cmd command.for example : cls > > how can i run this method? The second argument is a variadic argument, so you can omit it; see

Re: [go-nuts] Re: exec.Command

2016-10-06 Thread Marvin Renich
* hadiesmail...@gmail.com [161005 09:16]: > but i test this code it does not work! > > Why?? People would be able to help you better if you said what you tried (by giving code; you can use play.golang.org if you want), and saying what happened and what you expected or wanted to happen. Also, so

Re: [go-nuts] don't understand the comment in spec Type assertions section

2016-10-13 Thread Marvin Renich
* d...@veryhaha.com [161013 08:42]: > https://golang.org/ref/spec#Type_assertions > > var x interface{} = 7 // x has dynamic type int and value 7 > i := x.(int) // i has type int and value 7 > > type I interface { m() } > var y I > s := y.(string)// illegal

Re: [go-nuts] What is called reference values in Golang?

2016-10-21 Thread Marvin Renich
* T L [161021 01:47]: > This faq, "Why are maps, slices, and channels references while arrays are > values?", https://golang.org/doc/faq#references. > thinks maps, slices, and channels are references. I think the "references" > here means "reference values". That's not the way I read it. The q

Re: [go-nuts] why "iota"?

2016-11-09 Thread Marvin Renich
* liyu1...@gmail.com [161109 08:26]: > I don`t know how to speak 'iota' too,I have to say "i---o---t---a" when I > talk with somebody. > > 在 2013年4月28日星期日 UTC+8上午8:52:36,mb0写道: > > > > > Wikipedia says it's a greek alphabet that looks like i, and I am seeing > > > APL used iota for something l

Re: [go-nuts] Are short variable declarations necessary?

2016-11-09 Thread Marvin Renich
* T L [161109 05:18]: > On Friday, October 21, 2016 at 11:26:46 PM UTC+8, T L wrote: > > Thanks, gri, this is almost the answer I want. > > > > I still have two small questions about the short form. > > 1. would it be good to allow all identifiers in a short form are old ones > > (assume there is

Re: [go-nuts] Are short variable declarations necessary?

2016-11-09 Thread Marvin Renich
* T L [161109 11:57]: > yes, := can be avoided totally. > but := really has some benefits. > > The contradiction is the short form is 80% good with 20% bad side effects. I disagree. I saves three characters and in doing so adds much more cognitive load to distinguish declaration from assignment

[go-nuts] html/template modifies template outside of actions

2016-11-11 Thread Marvin Renich
In this code (at https://play.golang.org/p/HVxzsn0_eC) package main import ( "fmt" "html/template" "os" ) var tmpl = ` {{range .}} {{.}}{{end}} ` var items = []string{"one", "two", "three"} func main() { var t, err = template.New("").Parse(tmpl) if err == nil { e

Re: [go-nuts] html/template modifies template outside of actions

2016-11-11 Thread Marvin Renich
* Ian Davis [16 06:04]: > On Fri, Nov 11, 2016, at 09:21 AM, Marvin Renich wrote: > > > the Execute method escapes the first character ('<' in " > "<". This seems wrong to me, both logically and according to the > > documentation, whi

Re: [go-nuts] Golang text template - time.Format epoch

2016-12-07 Thread Marvin Renich
* skrutsko via golang-nuts [161207 08:30]: > Hello > > I have a field in my text template: "start":"{{.Start.Format "Jan 02, 2006 > 15:04:05 UTC"}}" > > But, I want to have output as epoch time. E.g. 148110633400 > > Could you please explain how to do this ? Thanks Do you mean Unix time (sec

Re: [go-nuts] Re: converting slice of items into nested array

2016-12-08 Thread Marvin Renich
* Mikael Gustavsson [161208 03:55]: > There's no need to use maps, you want to follow this pattern: > > for i := range items { > if i==0 || !grouped(i-1, i) { > appendToResult > } > appendToGroup > } > > Here's the full example: https://play.golang.org/p/1e0rDDmq7b Note that this only

Re: [go-nuts] Golang text template - time.Format epoch

2016-12-08 Thread Marvin Renich
* 'Sergey Krutsko' via golang-nuts [161208 02:12]: > Thanks Marvin! > > that's exactly what i need > > bwt, is there any way to get current timestamp inside the template (without > referencing to the data structure) ? > > something like that: > "timestamp: {{time.Now.Unix}}" You can use a te

Re: [go-nuts] Reset Slice with Make Every Time?

2017-01-10 Thread Marvin Renich
* Tomi Häsä [170110 02:23]: > On Tuesday, January 10, 2017 at 1:49:37 AM UTC+2, kortschak wrote: > > On Mon, 2017-01-09 at 15:12 -0800, Tomi Häsä wrote: > > > Is this the correct way of resetting a slice? I mean do I always > > > need to use make to reset a slice? > > > > > > // initialize

Re: [go-nuts] Getting a pointer in a type switch gives a *interface {} if case lists several options

2016-06-22 Thread Marvin Renich
* raidopah...@gmail.com [160621 18:02]: > I have encountered some unexpected and inconsistent behavior with type > switches. Can someone shed some light as to why Go behaves this way? > > Take a look at https://play.golang.org/p/YPV5YPtWF8 > > I would expect both of the switches to behave the s

Re: [go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-08 Thread Marvin Renich
* Paulo Janeiro [160808 11:14]: > I understand what your point, but I'm just trying to see if this is > something easy to do by myself or if I should start looking into a framework > Nevertheless, I'm using Phoenixframework (Elixir). > Here we could define a layout that is made of componentes (pr

Re: [go-nuts] Understanding go routine heap

2016-08-20 Thread Marvin Renich
* Konstantin Shaposhnikov [160820 06:34]: > The code might be race free for the current Go implementation but I don't > think this behaviour is documented. > > https://golang.org/ref/mem doesn't mention sync.WaitGroup at all. So > wg.Done() doesn't necessarily happen before wg.Wait() returns a

Re: [go-nuts] Re: Understanding go routine heap

2016-08-22 Thread Marvin Renich
* Joubin Houshyar [160822 09:47]: > > > On Saturday, August 20, 2016 at 2:29:41 AM UTC-4, Yulrizka wrote: > > func process() *foo { > > var result *foo > > > > var wg sync.WaitGroup > > wg.Add(1) > > go func() { > > defer wg.Done() > > result = &foo{1} > > }()

Re: [go-nuts] Short vs. long variable declarations

2017-01-28 Thread Marvin Renich
* Will Faught [170127 21:58]: > Variable shadowing is rarely, if ever, a problem for me too; but what about > for newcomers? > > I think my copy/paste point stands, though; everyone has those problems, at > least occasionally. I agree with you. See my earlier post for my reasoning: https://gro

Re: [go-nuts] Re: is it possible to speed up type assertion?

2017-02-02 Thread Marvin Renich
* T L [170202 04:20]: > > > On Thursday, February 2, 2017 at 4:58:32 PM UTC+8, Axel Wagner wrote: > > > > Hi, > > > > I can not really reproduce your results. I rewrote your code to use the > > builtin benchmarking: http://sprunge.us/IfQc > > Giving, on my laptop: > > > > BenchmarkAssertion-4

Re: [go-nuts] Re: is it possible to speed up type assertion?

2017-02-02 Thread Marvin Renich
* Marvin Renich [170202 09:22]: > > BenchmarkIface is testing the wrong thing; the value is swamped by the > implicit conversion of d (type T) to the function argument of type I. Or, maybe it is testing the correct thing. That is the problem with microbenchmarking. Try benchmar

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread Marvin Renich
On Tue, Feb 21, 2017 at 1:46 PM, wrote: > Seems like named returns + if/for/switch initializers = a shadowing > nightmare. I wish the Go compiler emitted a loud warning on shadowing, as > this is a dangerously subtle problem out there. * Ian Lance Taylor [170221 16:13]: > Yes, named returns may

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread Marvin Renich
* John Souvestre [170222 11:16]: > Ø does it sounds good to disable (in specs) named return vars shadowing ? > > This would help, I don't think this is a good solution. It also breaks Go 1 compatibility. > but the := problem isn’t limited to return variables. > I think that it’s when there ar

Re: [go-nuts] Re: Is uint(v) when v is minus because a huge number supposed behavior?

2017-02-26 Thread Marvin Renich
* peterGo [170225 22:40]: > On Saturday, February 25, 2017 at 10:21:49 PM UTC-5, Felix Sun wrote: > > https://play.golang.org/p/TmxMmltHGH > > > > package main > > > > import ( > > "fmt" > > ) > > > > func main() { > > var f int = -1 > > fmt.Println("become huge number:", uint(f)) > > fmt.Println(

Re: [go-nuts] memory gc when slice shortcut

2017-03-09 Thread Marvin Renich
* 代君 [170309 05:45]: > I have a []*Struct, at some times it length grow to 1000, after that, the > slice be shortcut to length of 10, and never grow to 1000 again. > > dose the memory of *Struct at slice's tail will never be gc? What Jan says is correct, but if your program logic can determine

Re: [go-nuts] Re: Building with "go install" vs "go build"

2017-04-18 Thread Marvin Renich
* Dave Cheney [170418 09:57]: > > Apparently Dave Cheney says to prefer "go install" over "go build"[3], > except when cross-compiling [4]. However, many of these posts are older, > and Golang moves at such a rapid clip that it's difficult to keep track of > what everybody is doing. > > This i

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread Marvin Renich
* mhhc...@gmail.com [170509 07:10]: > Also i think go has already several patchers that you might get > inspiration from, not sure where they are located. Sorry : x Try man gofmt and look at -r. ...Marvin -- You received this message because you are subscribed to the Google Groups "golang-nut

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread Marvin Renich
[I set an explicit Reply-To header because I do not want duplicate emails. Please do not CC me; I read this list.] * mhhc...@gmail.com [170509 07:40]: > : ( thanks > > $ man gofmt > Aucune entrée de manuel pour gofmt > /no such entry/ One of many advantages of the Debian distribution is that p

Re: [go-nuts] Re: issues about struct align

2017-05-22 Thread Marvin Renich
* xjdrew [170522 02:06]: > How can i use this kind of Go in windows? my machine is 64bit also. If I > download the amd64 Go, the pointer size will be 8 bytes. > > My real issue is , when I call win32 api, uint64 type in the struct of > win32 is aligned to 8 bytes. > I have to pad the go struct

Re: [go-nuts] Re: issues about struct align

2017-05-23 Thread Marvin Renich
* xjdrew [170523 02:31]: > Marvin, thanks. > > What i'm doing is similar to your guessing. > > I use syscall.Syscall to call win32 api, and encounter some padding issues. > I have resolve my problems by mannual padding days ago, but I want to know > if there is a more graceful way to finish tha

Re: [go-nuts] Re: issues about struct align

2017-05-23 Thread Marvin Renich
* Marvin Renich [170523 08:58]: > Looking more closely at the MSDN docs for FwpmFilterAdd0 and > FWPM_FILTER0, if I were doing this, I might use «RawContext uint64» > instead of «ProviderContextKey GUID», which would be properly aligned > without manual padding. I would then conver

Re: [go-nuts] os.Args[0] for program executed by go

2017-06-01 Thread Marvin Renich
* Santhosh Ram Manohar [170601 14:03]: > > > On Thursday, June 1, 2017 at 10:45:56 AM UTC-7, Jan Mercl wrote: > > > > On Thu, Jun 1, 2017 at 7:41 PM Santhosh Ram Manohar > > wrote: > > > > > Args: []string{"self", "selftest"}, > > > > Here you explicitly pass arsg[0] == "self" and that's what t

Re: [go-nuts] Save file handle into struct

2017-06-07 Thread Marvin Renich
* Tong Sun [170607 15:53]: > So, Here is the update version. > > 1. https://play.golang.org/p/txOIO1riwd > 2. https://play.golang.org/p/_Qk9n0mZPM > > The two version only differ on line 26 & 29. However, the second one will > get the following while trying to do *gofmt*: > > 29:2: expected i

Re: [go-nuts] Handling errors in functions

2017-06-21 Thread Marvin Renich
* suburb4nfi...@gmail.com [170621 08:44]: > Is it possible to give a default nil value to an error at the beginning of > a function and then just assign to it in case of need ? What I want to do > is something like the following : > > func GetSummonerByName(name string, server string) *Summone

Re: [go-nuts] Handling errors in functions

2017-06-21 Thread Marvin Renich
* Marvin Renich [170621 09:48]: > package main > > import ( > "fmt" > ) > > func Calc(a int) (r int, err error) { > if a == 0 { > err = fmt.Errorf("Bad argument") > return > }

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-07 Thread Marvin Renich
* T L [170707 01:32]: > Then how about this? > > package main > > import "fmt" > import "sync/atomic" > > func main() { > var x, y int32 > go func() { > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) > }() > > if atomic.LoadInt32(&y) == 1 { > fmt.Pr

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-09 Thread Marvin Renich
* T L [170709 04:56]: > On Friday, July 7, 2017 at 8:42:28 PM UTC+8, Marvin Renich wrote: > > Yes, the go routine establishes a happens-before relationship such that > > x is incremented before y, and the atomic Add of y and Load of y ensure > > that the Load either happens

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
[Reply-To set; I don't need two copies of replies.] * T L [170710 12:31]: > so this is guaranteed by Go memory model? > > package main > > import "fmt" > import "sync/atomic" > > func main() { > var x, y int32 > go func() { > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y,

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
* T L [170710 12:32]: > so this is guaranteed by go memory model? > > package main > > import "fmt" > import "sync/atomic" > > func main() { > var x, y int32 > > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) > > if atomic.LoadInt32(&y) == 1 { > fmt.Println("x

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
* T L [170710 12:35]: > so this is guaranteed by Go memory model? > > package main > > import "fmt" > import "sync/atomic" > import "unsafe" > > func main() { > var x, y int32 > > var p = unsafe.Pointer(&x) > > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) > >

Re: [go-nuts] Re: bufio.Reader.Buffered returns 0

2019-12-16 Thread Marvin Renich
* Ian Lance Taylor [191215 23:05]: > The Buffered method [snip] tells you how > many bytes you can Read without causing a call to the underlying > Reader. I think this would be a significant improvement over the current ambiguous documentation. It should adequately dispel any unrealistic expecta

Re: [go-nuts] doubt about reflect.Type.String and empty interface

2020-01-07 Thread Marvin Renich
* Manlio Perillo [200106 18:57]: > I wrote another test https://play.golang.org/p/hoTAnijCfg1. > Now it is clear why the first entry can only print nil for the type > and for the value. > > However printf %v verb prints nil for both an empty interface and an > interface with a dynamic value of n

Re: [go-nuts] Should it panic when set a channel to nil concurrently

2020-03-02 Thread Marvin Renich
* Yuan Ting [200301 23:50]: > I write a simple program likes below and it triggers a data race alarm with > -race flag. But no matter how I run, this program will not panic. I know it > is legal to receive messages from nil channels, but I don't quite > understand why this program does not pani

Re: [go-nuts] go run requires internet connection?

2020-04-08 Thread Marvin Renich
* Tanmay Das [200408 12:17]: > Hey Gophers, > My very first post here. > > Today I faced an unexpected power outage and I wanted to tinker with Go a > little bit. I wrote a simple hello world program and ran > go run helloworld.go > > Strangely the code didn't run. In fact, the terminal prompt

[go-nuts] wording in Go tour, methods/19

2020-04-15 Thread Marvin Renich
In the Go tour at https://tour.golang.org/methods/19 it says The error type is a built-in interface similar to fmt.Stringer: The words closest to "similar to" are "built-in interface", implying that the way error is similar to fmt.Stringer is that it is a built-in interface, which it clearly is

[go-nuts] "Go build failed." in Go tour requires explicit Kill

2020-04-15 Thread Marvin Renich
In the Go tour, what is the purpose of requiring the user to explicitly press the "Kill" button when the build fails? This seems completely unnecessary to me. If this is just a natural consequence of the internal implementation, it would, in my opinion, be well worth the effort to make a failed b

Re: [go-nuts] Re: wording in Go tour, methods/19

2020-04-16 Thread Marvin Renich
* Volker Dobler [200416 02:28]: > On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote: > > > > In the Go tour at https://tour.golang.org/methods/19 it says > > > > The error type is a built-in interface similar to fmt.Stringer: > > I agree that t

Re: [go-nuts] Re: "Go build failed." in Go tour requires explicit Kill

2020-04-16 Thread Marvin Renich
* Brian Candler [200416 12:20]: > I've noticed this too. This is with the tour, rather than play.golang.org. > > To reproduce (I'm using Chrome 80 under macOS 10.14): > > * Go to a tour page which doesn't compile, e.g. > https://tour.golang.org/methods/25 > * Click Run > * At this point it sho

Re: [go-nuts] Go Tour ok?

2020-04-21 Thread Marvin Renich
* Anssi Porttikivi [200421 08:57]: > I had to run the Go Tour locally, because the web version gives me odd > "timed out" and "build failed" (with no reason) errors > indeterministically... Is it just me? I was having the same trouble earlier today. The build (or run) was timing out, and the t

Re: [go-nuts] keyword func

2020-04-27 Thread Marvin Renich
* レミリア・スカーレット [200427 12:46]: > Why you need to write a "func sum(a, b int) int {...}", not "sum(a, b int) > int {...}"? > It seems to me that one could do without func keyword. I believe another reason is that the Go language designers decided that every top-level syntax element begins with a k

Re: [go-nuts] Type Assertion on File type

2020-05-07 Thread Marvin Renich
* André kouamé [200507 12:57]: > I want to check, if the value return by my function has the type *os.File > This my code : > func createFile(filename string) (*os.File, error) { > f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) > return f, err > > } > //Test code > fil

Re: [go-nuts] Re: help understanding weird Benchmark results

2020-05-19 Thread Marvin Renich
* Warren Bare [200519 13:53]: > OK, I added a sum of the rand to the demo code and the results are the > same. Since it is displaying the sum, it seems clear that the code is not > optimized away. > > Again, I am NOT trying to time each iteration of the loop. This is a > minimal demonstratio

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [200614 20:15]: > No, what you said is, that objecting to the banner may not be *political*. > You didn't mention parties and neither did I. And I stand by my statement, > that objecting to the banner *is* inherently a political act. And that > claiming to object on

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Marvin Renich
* Sam Whited [200615 09:34]: > This is an important issue about the Go Community and who feels welcomed > here, which is also covered by this mailing list. This is _so_ wrong. The evidence that this banner has caused substantial divisiveness and offended many members of the Go community is obvio

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Marvin Renich
[Note To and CC] Please consider this a formal request for the Go Project Stewards to review the website banners being discussed in this thread and to make a determination that these banners are causing divisiveness in the Go Community and have offended some, and that the banners' content is inapp

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-19 Thread Marvin Renich
* Ian Lance Taylor [200619 00:20]: > It's an important discussion, but having it on golang-nuts is not working. > > It can continue off-list. You post a banner within the Go community that is off topic and is highly controversial (this thread is clear evidence of that). You then squelch discuss

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-19 Thread Marvin Renich
* Marvin Renich [200619 11:17]: > You post a banner within the Go community that is off topic and is ^ Just to be clear, the "you" in this paragraph is not you, Ian, personally. I am referring collectively to the maintainers of the web sites and mailing lists in their offici

[go-nuts] accessibility of module version information in executable

2020-06-26 Thread Marvin Renich
When building a command with go build that imports modules, does the resulting executable contain information about which modules are included as well as their versions? If so, is there a tool available to extract that information from the executable? Can the information be retrieved from within

Re: [go-nuts] Re: accessibility of module version information in executable

2020-06-26 Thread Marvin Renich
* seank...@gmail.com [200626 12:31]: > go version -m $binary > > runtime/debug.BuildInfo Thanks much! I looked through runtime, but did not think to look at runtime/debug. I was completely unaware of the -m option to go version. ...Marvin -- You received this message because you are subscri

Re: [go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread Marvin Renich
* yves baumes [200629 03:22]: > Hello, > > considering this code > > ``` > package main > > import ( > "fmt" > ) > > func main() { > host := []string{"127", "0", "0", "1"} > > fmt.Printf("%v.%v.%v.%v\n", host[0], host[1], host[2], host[3]) > fmt.Printf("%v.%v.%v.%v\n", host[0:4]...) > } > ```

Re: [go-nuts] Expanding variables and fmt.Printf() issue

2020-06-29 Thread Marvin Renich
[pedantic correction] * Marvin Renich [200629 14:10]: > The final argument to Printf is []interface{}, while you are trying to ^ ...interface{} ...Marvin -- You received this message because you are subscribed to the Goo

Re: [go-nuts] my package not include in go modules

2020-07-29 Thread Marvin Renich
* Ali Hassan [200725 01:04]: > I want to import libraries in module file but modules add all other > libraries except those packages which I had created, DB is one of them. How > to import? > Error , please help me > to resolve Also note th

Re: [go-nuts] Re: module confusion

2020-08-14 Thread Marvin Renich
* Volker Dobler [200814 14:53]: > On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: > > Isn't this the default location? I just untarred the distribution... > > No. There is a reason https://golang.org/doc/install#install > states to do tar -C /usr/local -xzf go$VERSION.$OS-$AR

Re: [go-nuts] Re: module confusion

2020-08-15 Thread Marvin Renich
* fge...@gmail.com [200815 03:44]: > On 8/15/20, Marvin Renich wrote: > > * Volker Dobler [200814 14:53]: > >> On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: > >> > Isn't this the default location? I just untarred the distribution... &g

Re: [go-nuts] Re: How to know if interface{} data is nil w/o reflecting?

2020-08-27 Thread Marvin Renich
* targe...@gmail.com [200827 05:40]: > On Thursday, August 27, 2020 at 12:20:59 PM UTC+3 axel.wa...@googlemail.com > wrote: >> I'm saying the current situation is less confusing than what you >> describe, yes. >> >> AIUI, with what you describe, if I have a variable `x` of type `*T` >> and an int

Re: [go-nuts] Definition of Method sets

2020-09-04 Thread Marvin Renich
* Yuu LongXue [200904 05:31]: > Hi all, > > I’m confused by the "method set" defined in go > specification,any one can help explain? > > The Go Programming Language Specification says that : > ``` > The method set of any other type T consists of all methods >

Re: [go-nuts] Re: While implement ssh client using golang, record keyboard input

2020-09-15 Thread Marvin Renich
* sc3983...@gmail.com [200915 11:41]: > Hi Everyone: > > I have the same problem, How do I get user input command, with *SSH > client with a Interactive Shell* > > 在 2018年10月23日星期二 UTC+8上午4:57:50,Sun Frank写道: > > > > Hi Everyone: > > > > I came across a problem which puzzled me for couple

Re: [go-nuts] Should the program print true or false?

2020-09-17 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [200917 12:05]: > I think you might've intended this, which does indeed print true: > type S []S > var a, b S > a, b = S{0: b}, S{0: a} > fmt.Println(reflect.DeepEqual(a, b)) I was guessing he meant: type S []S var a, b S a = S{0: b} b = S{0: a}

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
* Uzair Ally [201027 12:25]: > Hi, > > I am getting the following error when I try to call a powershell script > from go. > > undefined: script > > Here is the code: > > cmdName := "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" > out, err := exec.Command("cmdName", script.ps

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
mdName without the quotes: out, err := exec.Command(cmdName, "script.ps1").Output() I was just answering too fast. > On Tuesday, October 27, 2020 at 8:22:14 PM UTC+3 Marvin Renich wrote: > > > * Uzair Ally [201027 12:25]: > > > Hi, > > > > > &g

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
* Uzair Ally [201027 14:19]: > Hi Jake, > > The code I posted is the runnable go program just missing the powershell > script which is a separate file. Maybe I'm miss understanding? Is there > something else I can provide to help you understand further? Based on the your original message and t

Re: [go-nuts] In Go the type size of 1 byte can reach 1 kilobyte, even 1 terabyte or much more.

2020-12-10 Thread Marvin Renich
* Christian Maurer [201210 07:37]: > > // Proof: Set n to a number >= 39 in the following program: > > func main() { > const ( > b = byte(0xc0) > n = 9 > ) > s := []string{string(b)} > for i := 0; i < n; i++ { > s = append(s, []string{""}...) > } > for i := 0; i < n; i++

Re: [go-nuts] package is not in goroot

2021-01-20 Thread Marvin Renich
* Alexander Mills [210119 16:54]: > i am getting this weird error message: > > package twitch/go-scripts/dynamo-creators-to-s3/lib is not in GOROOT > (/usr/local/Cellar/go/1.15.6/libexec/src/twitch/go-scripts/dynamo-creators-to-s3/lib) > > my GOPATH=$PWD/scripts/go > > so there is only 1 GOPA

Re: [go-nuts] package is not in goroot

2021-01-20 Thread Marvin Renich
* Jan Mercl <0xj...@gmail.com> [210120 09:32]: > On Wed, Jan 20, 2021 at 2:58 PM Marvin Renich wrote: > > > The error message is really incomplete, and therefore confusing. It > > should be "package ... is not in GOROOT or any element of GOPATH". > >

Re: [go-nuts] package is not in goroot

2021-01-20 Thread Marvin Renich
* Marvin Renich [210120 09:58]: > * Jan Mercl <0xj...@gmail.com> [210120 09:32]: > > On Wed, Jan 20, 2021 at 2:58 PM Marvin Renich wrote: > > > > > The error message is really incomplete, and therefore confusing. It > > > should be "package .

Re: [go-nuts] package is not in goroot

2021-01-20 Thread Marvin Renich
* Jan Mercl <0xj...@gmail.com> [210120 10:46]: > On Wed, Jan 20, 2021 at 3:57 PM Marvin Renich wrote: > > > I don't understand what you are saying. What is a "reserved import > > path" and where is it defined? > > See https://github.com/golang/go/is

Re: [go-nuts] package is not in goroot

2021-01-20 Thread Marvin Renich
* Jan Mercl <0xj...@gmail.com> [210120 15:27]: > On Wed, Jan 20, 2021 at 9:03 PM Marvin Renich wrote: > > > I still cannot find any mention of reserved import paths in any > > documentation (go help modules/importpath/gopath). It's just an issue > > on the t

Re: [go-nuts] Re: Compiler treatment of infinite loops

2021-03-05 Thread Marvin Renich
* Brian Candler [210305 10:21]: > There is a flip side to that: if you add the return statements, then > ForLoop1() gives an error due to unreachable code! > https://play.golang.org/p/0bajnJWTz7U > > So you can't win either way. I think this implies that if the behaviour > were changed now, it

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-17 Thread Marvin Renich
* Jan Mercl <0xj...@gmail.com> [210317 06:27]: > On Wed, Mar 17, 2021 at 10:57 AM mortdeus wrote: > > I'm probably giving up any hopes to work for Google in the future by > writing this: +1. I find the banner deeply offensive, divisive and > excluding for people with dissenting views, regardless

Re: [go-nuts] time.Format with "Month Year" format incorrectly displayed

2021-05-06 Thread Marvin Renich
* Kurtis Rader [210505 23:35]: > On Wed, May 5, 2021 at 8:23 PM Bagas Sanjaya wrote: > > > On 06/05/21 04.37, Ian Lance Taylor wrote: > > > You wrote 2009 where you need to write 2006. > > > > Wouldn't it possible to define arbitrary reference time and format it > > according to what it would

Re: [go-nuts] extract Last 2 characters in go template

2021-05-28 Thread Marvin Renich
* Pawan Kumar [210528 12:43]: > Hi Team, > > I was using slice function to extract last 2 characters in go template but > not able to do ,as -ve range is not supported by slice function . > > For example - My cluster name is turbo-ab-03 , i can extract if i know > exact length of cluster na

Re: [go-nuts] extract Last 2 characters in go template

2021-05-30 Thread Marvin Renich
* Pawan Kumar [210530 08:03]: > Many thanks Marvin , really appreciate it. I intended, but forgot, to hint that your FuncMap could include a function that was more specific to your problem than the sub function. ...Marvin -- You received this message because you are subscribed to the Google Gr

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Marvin Renich
* 'Dan Kortschak' via golang-nuts [210606 06:43]: > On Sun, 2021-06-06 at 03:17 -0700, Brian Candler wrote: > > When you assign a regular (non-pointer) value to an interface > > variable, it does take a copy of that value: > > https://play.golang.org/p/XyBREDL4BGw > > It depends on whether it's s

Re: [go-nuts] Re: Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Marvin Renich
* Joshua [210606 16:52]: > > In most cases (or most cases in actual practice?) an interface can be > > thought of as a pointer, > > This is however, an implementation detail specific to the compiler you use > though, correct? Well, sort of, but really no. Whether the compiler wastefully make

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-07 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [210607 10:19]: > FWIW I do tend to mix value and pointer receivers occasionally. > Sometimes a type needs a pointer receiver in one method, but a different > method doesn't and it's more convenient to have a copy available for > temporary operations. Axel, I belie

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-07 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [210607 19:06]: > Well, it seems a bad idea to say that interfaces are implicitly pointers > then. That seems to indicate that Rob's original phrasing is indeed an > important clarification - the language behaves as if the value contained in > them is copied when th

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-07 Thread Marvin Renich
* Robert Engels [210607 21:18]: > (I think you pasted the wrong link - that is my code). subsequent correction acknowledged; assuming the following discussion is about https://play.golang.org/p/-f73t_Pm7ur > It is not about being unwilling to admit it. Your > explanation/reasoning has not convi

Re: [go-nuts] Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-08 Thread Marvin Renich
* 'Axel Wagner' via golang-nuts [210608 02:54]: > On Tue, Jun 8, 2021 at 6:36 AM Marvin Renich wrote: > > > You say that test cases of Log work fine, but they are only fine in a > > non-concurrent environment. The instant you test Log (without > > interfaces

<    1   2   3   >