thank you. that works, and I think I also get the general idea.
On Sunday, 20 November 2016 17:30:06 UTC+5:30, Jan Mercl wrote:
>
> On Sun, Nov 20, 2016 at 12:55 PM Sathish VJ > wrote:
>
> > In the code below, why is the value of s not changed in the calling
> function?
>
https://github.com/julienschmidt/httprouter https://github.com/pressly/chi and
others actually use a function by default because it's the more common
case. See https://github.com/pressly/chi/issues/94#issuecomment-254516724
On Mon, Nov 21, 2016 at 12:39 AM Tamás Gulácsi
I don't think so. A http.Handler usually has a ton of state, so a struct's
method is handier than a closure.
And take a look at http.HandlerFunc!
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
In relation to this question, do you guys think it would have been better
had http.Handler been a function, not an interface?
On Sun, Nov 20, 2016 at 11:23 PM Henry wrote:
> Thanks for the replies. In terms of future extensibility, is it safe to
> say that interface
Thanks for the replies. In terms of future extensibility, is it safe to say
that interface is superior to first-class functions?
--
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,
On Mon, Nov 21, 2016 at 10:24 AM, wrote:
> How to submit a change request?
If you're asking about how to submit code that you have written
yourself, the contribution guidelines are at
https://golang.org/doc/contribute.html
If you are asking how to file a feature request,
Thanks you for the link!
On Sun, Nov 20, 2016 at 7:15 PM Mandolyte wrote:
> Here's a link to an article by someone else who went down this path and
> they explain a bit about how they went about going deeper...
>
> http://thorstenball.com/blog/2016/11/16/putting-eval-in-go/
you'll need interfaces if you want your 'thing' to leave the programs
context, to store/transmit 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
How to submit a change request?
I'm posting to this group, because there is no issue tracker on the
http://golang.org/x/mobile/exp/audio/al package.
Dňa sobota, 29. októbra 2016 7:04:06 UTC+2 Daniel Theophanes napísal(-a):
>
> I would love to also see this happen. If you have time feel free to
Hi,
Question about using dynamic libraries on Linux. So I know that creating a
shared .so for the golang standard library can be done via the following
(or some appropriate cross compiling variant):
go install -buildmode=shared -linkshared std
When stripped of debugging information, this
It looks like you've structured your config as a tree. If you decide to allow
modifications to that tree, each modifying operation should return a new tree,
leaving the original untouched.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
>
> Make your data structure immutable
>
Would you be so kind to elaborate it a little bit?
If I use structs, then I still have to lock on config update.
Or I could create a Cfg() which returns a copy, and SetCfg() for setting,
and they'd do the locking with RWMutex?
--
You received this
Thank you very much for the replies.
I've read the blog about slices again and I'm pretty sure I know what is
happening in my example and how are dst and src interconnected.
I've started thinking how I can achieve what I'm looking for in the nicest
way, and after some trial and error, I've come
The following answer to a similar question answers how to do, what I want
to do without altering commands issued by go build -x.
Maybe I should had rephrased my question.
https://groups.google.com/d/msg/golang-nuts/NPEKogRR9Q0/IC-IUUy7CQAJ
So you can declare symbols as weak (which I didn't
I tried to break down the thought process on this exact question earlier
this year and gave a presentation at my local Go meetup. My slides are here:
http://go-talks.appspot.com/github.com/ChrisHines/talks/non-orthogonal-choices-in-go/non-orthogonal-choices-in-go.slide
Hi! Thanks for your answer!
Am Sonntag, 13. November 2016 21:42:20 UTC+1 schrieb Justin Israel:
>
>
>
> I had been down a similar path where I was trying to port a go library to
> C++ via building a c-shared library and then delegating to it from a thin
> C++ API.
>
Turned out I hit problems
To be more concrete, taking your example, PerformWork cannot be easily
customized according to the type of first class function that returns a
func(Data).
Actually it goes further, because that first class function can "only"
return a func(Data) and not multiple functions.
With an interface,
You have less indirection with the interface. More ergonomic.
An interface also allows to define a set of constraints whereas the first
class function does not coerce you into having a defined set of function
arguments.
On Sunday, November 20, 2016 at 6:22:57 AM UTC+1, Henry wrote:
>
> Hi,
>
>
Here's a link to an article by someone else who went down this path and
they explain a bit about how they went about going deeper...
http://thorstenball.com/blog/2016/11/16/putting-eval-in-go/
On Friday, November 18, 2016 at 10:41:57 PM UTC-5, nvcnvn wrote:
>
> All I ever do is some simple web
On Sun, Nov 20, 2016 at 12:55 PM Sathish VJ wrote:
> In the code below, why is the value of s not changed in the calling
function?
Interface is just a value, to indirect through a pointer it contains one
can do something like: https://play.golang.org/p/qbx6ltL_SN
--
-j
In the code below, why is the value of s not changed in the calling
function?
func f(resp interface{}) {
resp = "abcd"
}
func main() {
var s string
f()
fmt.Println(s) //prints blank?
}
Play link: https://play.golang.org/p/KtfooO-cNt
--
You received this message because you are subscribed
Hello Bogdan
You're asking a very legit question. Slices are powerful but using combinations
of append and reslicing can be surprisingly subtle.
Step1 is easy: slicing is basically creating a new header referencing a
position in an existing array, it does NOT by itself modify src.
Step3 is
22 matches
Mail list logo