Anyone who doesn't want some form of generics is in favor of a bad status
quo. Now I'll be fine without user defined generics if Go provided a dozens
of built-in compile time safe generic data structures like trees, sets,
tuples, ordered maps, weakmaps perhaps WITH a complete set of methods like
A 9 yo shouldn't be online talking to adult strangers, it's irresponsible
for whoever is in charge of that group to let that thread open, let alone
let a 9 y.o. in this group when the internet is full of child predators.
Le lundi 28 mai 2018 02:31:42 UTC+2, John a écrit :
>
> Okay I will confess
If you really have legal concerns you should talk to a lawyer. Asking for
anonymous opinion on a forum isn't legal advice. This should certainly not
be the place to discuss legal matters such as the scope of a license. I
don't think anybody who answered you is actually a lawyer. If you come upon
> Eliminating code duplication shrinks the base of code that must be changed
Except go was designed a certain way that will make whatever you are
attempting to do here burdensome. We've all been there at first trying to
fit a square into a round hole, it doesn't work. Unless you start ignoring
Can anybody point me to a single discussion on golang-nuts that led to a
significant syntax change? These threads are akin to bike shedding thus a
waste of time.
Adding while provide nothing of value in a language that supports basic
looping. And for those who compare if and switch arguing it
No, go does not have generics.
chan int is not the same type as chan string for instance and you cannot
declare a type that hold all types of channel unless you resort to
"interface {}" AND runtime reflection.
Le jeudi 22 mars 2018 16:25:39 UTC-10, 刘焱 a écrit :
>
> I'm trying to define a Refere
How is this a bug? I don't think Go compiler can guess the intent of the
developer at compile time.
I don't think that qualifies as bug.
Le mardi 13 mars 2018 16:48:32 UTC-3:30, Christopher Sebastian a écrit :
>
> @prades.marq , The solution that you pointed out is already obvious to
> everyo
> In the example, there is a "typo" in the spelling of a method name
("Bg" instead of "Bug"), and that typo caused the generate code to
exhibit an infinite recursion in method lookup.
No, it has nothing to do with a "typo". I removed the Bg() method and
infinite recursion still occurs a
The answer is it depends on the context. There is no way to answer that
question without looking at the full codebase and what method will call a
type implementing the Store interface. In general, you should only put the
methods in an interface the consumer of a value will use.
given a function
If (somehow) Go get Ada style package based generics then a lot of the
language doesn't have to change.
The consumer of the generic package will have to "instantiate" the package
before using it. Therefore
A codebase cannot be littered with parametric type variables.
So generic functions would
Wasn't Sqlite compiled to Go or something? I remember some news about it,
using C to Go compiler.
As for the C toolchain for Go, the easiest way to get started on Windows is
to install MSYS2 and use pacman to install GCC 64 and then libs like
sqlite2 .
Le mercredi 21 février 2018 21:49:50 UTC
Go is hot right now just like Rails or Node.js used to be hot. So people
feel compelled to use the hip thing right now even when they hate it
because of fear of missing out. There are better languages out there like
Ada who do everything Go does, including concurrency but better and have
generi
Have a look at Rust, Ada or even C++, they all have some form of generic
programming and are fast or faster than Go. Bonus, none of these use
garbage collection.
Don't hold your breath with Go getting any substantial changes in its type
system. Move on.
Developers should use tools that suit t
It doesn't really matter, how many files you divide a single package into.
What matters is not multiplying the number of nested packaged without a
very good reason.
Le samedi 25 novembre 2017 04:23:06 UTC+1, Denis Cosmin a écrit :
>
> I made an errors.go file containing all the error values for
Since functions are values you can just do that:
var NewExternalService func()Service = pkg.NewExternalService
and then mock NewExternalService
or explicitely inject dependencies in your http.HandlerFunc
func(Service) http.HandlerFunc{
return func(w http.ResponseWriter, r *http.Request){
It's the client which does the redirect, it's up to it to accept your
request, most will not accept redirects with POST method, for obvious
security reason.
Le samedi 28 octobre 2017 21:12:16 UTC+2, Hui Kang a écrit :
>
> Hi,
> I have a question about sending POST request through the http.Redire
I submitted several original projects i made to your list, they passed all
the tests, they sat in the pull-request list for 6 month then when rejected
for disingenuous or unspecified reasons.So I would prefer not your list
becomes the official one.
Le lundi 23 octobre 2017 17:20:00 UTC+2, Thiag
Personally it's not a verbosity issue but a readability issue 99% of the
time.
if go fmt would just keep the whole if statement on a single line it would
already alleviate some of the pain of having to read
a codebase ridden with error handling code.
if foo,err = DoIO();err!=nil{return err
Or you know, just panic ... errors as value are a convention, not a
language construct.
panic/defer ARE a language construct. I personally give the choice in my
API, Must prefixed methods that panic or regular methods that return an
error.
The obvious advantage of panics is that the developer a
> That's how C++ started.
And that's also why C++ is the ugly monster than it is today; with a design
that wasn't quite thought thoroughly. Talking about C++ like it's an
example to follow is just preposterous.
Le dimanche 27 août 2017 16:25:54 UTC+2, Jan Mercl a écrit :
>
> And there's nothing
> Codegen can do 100% of what any compiler can do.
Yes and it is called doing the compiler's job in place of it.
--
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
> A lot of people consider code gen a second class solution when compared
to a more traditional generics implementation. I don't think so. Code
generation can be very effective. No major concerns about indecipherable
error messages. When in doubt you can inspect the generated code to
understand
I love playing with package reflect, which is much more powerful than
generics by the way (you can't implement gob or json with generics).
You could absolutely do that without runtime reflection. It is called
compile time type safe macros ... Oh wait, Rust has them, and generics and
a correct i
>
> Not true. interface{} and reflection is, for example, used by fmt.Printf
> for purpose where generics won't help. Alternatively everything must have a
> Format() method. But predeclared types cannot have methods.
write a compile time type safe generic *reduce *function with the following
What is overrated is the use of "interface { }" and reflection AKA runtime
magics which has no place in a modern statically typed language. It's a
cop-out, it's dirty and a direct consequence of the absence of generics in
Go.
> Please provide some best practices to achieve generic behavior for
Go could have least have parametric functions (ex :
func Foo(value T)T { /.../ }
bar := Foo(3) //types are verified at compile time, no need for
reflection or interface {} on any runtime trick.
).
But talking about this is kind of useless until Go rids itself of its over
reliance on runtime f
There was already an extensive survey published this year asking that kind
of question :
https://blog.golang.org/survey2016-results
You'll already get more data than you want here.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscrib
The goal of a (proper) router is to decouple routes from handlers, thus
making refactoring easier by adopting a declarative form rather than an
imperative one. It's the good old builder pattern. By deeming it
unnecessary you did nothing but couple your handlers with your routes.
That's the only
Nowhere in the piece of code you pasted you are calling a function, you are
trying to call a struct method on the other hand ( method.Call ). Your
error comes from something else and not the fact Go removes unused
functions.
Furthermore, if the number of possible struct methods to call is finit
A language with such a "simple" type system, which rely that much on
runtime behavior is hardly a language of the future. But Go might be a blue
print for what language of the futures will have to provide in terms of
developer experience. Go is too divisive to get widely adopted or to
replace a
You would test it the same way you test anything that depends on IO, you
don't make your function depend on a random number or an unpredictable
value, the random number should be a function parameter.
In order to test something it must be made testable. Right now your
function is not.
Le merc
You might want to reconsider your use of Go if the lack of generics hinders
your productivity. Code generation, IDE macros and other tricks do not
solve this problem.
Sometimes go is just not the right tool for the job. D has generics and
solid concurrency primitives.
Le vendredi 10 mars 2017
Named returns are actually quite useful with panics :
https://play.golang.org/p/ZdoZJBN0T1
Le mardi 21 février 2017 23:13:11 UTC+1, Ian Lance Taylor a écrit :
>
> On Tue, Feb 21, 2017 at 1:46 PM, >
> wrote:
> > Seems like named returns + if/for/switch initializers = a shadowing
> > nightmare
+1 , delete it. Or let some other group take care of it and remove any
official connection / link to golang.org . That farce lasted long enough.
Let's concentrate on promoting Go the right way, not on a forum full of
toxicity and shoddy admins. Stackoverflow is a better way to ask focused
quest
All I see here is nothing is done to moderate /r/golang despite threads
being reported for harassment. What good is a code of conduct if it isn't
enforced ? and when enforced , moderators have to come here to apologize
for doing their jobs, like Sarah ? If you don't want me to bring /r/golang
h
> then labeling someone's thread as "bullying" (a pretty serious charge in
todays climate).
Well now the target of the latest witch-hunt /u/gernest_ has responded on
/r/golang, the previous thread that I linked I quote "broke his heart" , so
you can't deny something is definitely wrong here :
That's not up to you to judge if some comment is "harmless" or not. Because
you're not the person the comment has been directed at. Something that
might seem "harmless" to you might be perceived as insulting to someone
else. Aram's comment was unnecessary and insensitive to say the least, it
do
This person is old enough to answer me himself, he doesn't need your help
for that , I wasn't talking to you so mind your business. And how about you
dump your patronizing tone and go back to your own business ? Your comment
is useless.
Le vendredi 28 octobre 2016 13:30:33 UTC+2, Manuel Amador
Sure you willfully participate on a forum often used for insults, character
assassination, witch hunts and doxxing. This isn't the first time shit like
this happens on /r/golang , and frankly it gives the whole Go community a
bad name. Keep being embarrassed "on my behalf", Who the hell do you t
> The actions of the Iris author are, in my opinion, pretty awful. But the
only people that can take action against them are the people whose code he
stole.
This is completely irrelevant IMHO. Why are these witch hunts allowed in a
go forum ? I'm not talking about the author of this thread who
Frankly /r/golang is so toxic I stopped posting there, it should be either
shut down or officially excluded from any official go forum.
The code of conduct serves very little purpose
given what happens there constantly,
People like to target projects, insult their author and call them thieves
41 matches
Mail list logo