Go Language Resources Go, golang, go... NOTE: This page ceased updating in October, 2012

--- Log opened Wed Aug 25 00:00:05 2010
00:09 < plexdev> http://is.gd/eBIm9 by [Russ Cox] in 29 subdirs of go/ --
build: $GOBIN defaults to $GOROOT/bin
00:09 < plexdev> http://is.gd/eBImg by [Russ Cox] in 2 subdirs of go/ --
build: update, streamline documentation for new $GOBIN
00:13 -!- crashR [~crasher@codextreme.pck.nerim.net] has quit [Ping timeout: 276
seconds]
00:14 < nf_> anyone around who has successfully used Go-SDL?
00:14 < nf_> if so, what platform and version of SDL are you running?
00:21 -!- esiroker [~esiroker@adsl-99-49-227-57.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
00:21 -!- esiroker [~esiroker@adsl-99-49-227-57.dsl.pltn13.sbcglobal.net] has quit
[Client Quit]
00:25 < plexdev> http://is.gd/eBJQo by [Russ Cox] in go/src/ -- build: fix
build - last CL missed Make.clib
00:25 < plexdev> http://is.gd/eBJQB by [Ian Lance Taylor] in
go/src/pkg/time/ -- time: Remove unused zoneinfo.go (replaced by
zoneinfo_unix.go).
00:27 -!- smw [~smw@c-76-28-90-0.hsd1.ct.comcast.net] has joined #go-nuts
00:31 -!- crashR [~crasher@codextreme.pck.nerim.net] has joined #go-nuts
00:37 -!- crashR [~crasher@codextreme.pck.nerim.net] has quit [Ping timeout: 276
seconds]
00:43 -!- crashR [~crasher@codextreme.pck.nerim.net] has joined #go-nuts
00:46 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has quit [Quit:
leaving]
00:50 -!- kanru [~kanru@118-168-238-233.dynamic.hinet.net] has quit [Read error:
Operation timed out]
00:54 -!- iant [~iant@66.109.106.2] has quit [Quit: Leaving.]
00:54 -!- mikespook [~mikespook@219.137.252.64] has joined #go-nuts
00:56 -!- tvw [~tv@e176001169.adsl.alicedsl.de] has quit [Ping timeout: 245
seconds]
00:57 < plexdev> http://is.gd/eBN58 by [Russ Cox] in go/src/ -- build: fix
build again - not sure where the " went.  sigh.
00:58 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has joined #go-nuts
01:02 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 255 seconds]
01:04 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
01:05 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
01:22 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
01:34 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Remote host
closed the connection]
01:37 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:43 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Remote host closed the
connection]
01:45 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
01:45 -!- stalled [~stalled@unaffiliated/stalled] has quit [Ping timeout: 265
seconds]
01:59 < plexdev> http://is.gd/eBUgl by [Russ Cox] in go/src/cmd/gotest/ --
gotest: remove lingering references to $GOBIN
02:01 -!- zerd_ [~quassel@tor.zerd.net] has joined #go-nuts
02:02 -!- zerd [~quassel@2a01:608:ffff:3644:2e0:4dff:fe83:76ed] has quit [Ping
timeout: 276 seconds]
02:02 -!- stalled [~stalled@unaffiliated/stalled] has joined #go-nuts
02:06 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
02:09 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
02:12 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
02:41 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 252
seconds]
02:42 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Remote host closed the
connection]
03:02 -!- rejb [~rejb@unaffiliated/rejb] has quit [Ping timeout: 276 seconds]
03:07 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
Leaving]
03:15 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
03:16 < plexdev> http://is.gd/eC2v5 by [Rob Pike] in go/src/pkg/scanner/ --
scanner: change package comment to be clearer about its functionality.
03:45 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 265 seconds]
03:45 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
04:08 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has joined #go-nuts
04:09 -!- mode/#go-nuts [+v iant] by ChanServ
04:18 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
04:23 -!- path[l] [UPP@120.138.102.50] has quit [Ping timeout: 240 seconds]
04:24 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 240 seconds]
04:41 -!- justindp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has joined #go-nuts
04:42 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit [Ping timeout:
258 seconds]
04:52 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has quit [Remote host closed
the connection]
04:55 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has joined #go-nuts
05:02 -!- scm [justme@d070152.adsl.hansenet.de] has quit [Ping timeout: 255
seconds]
05:04 -!- scm [justme@d019125.adsl.hansenet.de] has joined #go-nuts
05:04 < plexdev> http://is.gd/eCcDQ by [Andrew Gerrand] in 2 subdirs of go/
-- release.2010-08-25
05:04 < plexdev> http://is.gd/eCcE0 by [Andrew Gerrand] in go/ -- tag
release.2010-08-25
05:14 -!- sladegen [~nemo@unaffiliated/sladegen] has joined #go-nuts
05:18 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Quit:
Computer has gone to sleep.]
05:25 -!- crashR [~crasher@codextreme.pck.nerim.net] has quit [Quit: (◣_◢)
BigBrowser is watching ⓎⓄⓊ]
05:25 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
05:36 < plexdev> http://is.gd/eCfz9 by [Russ Cox] in go/src/pkg/syscall/ --
syscall: change BUG(brainman) to NOTE(brainman)
05:37 -!- zaero [~eclark@valkyrie.buick455.com] has quit [Ping timeout: 252
seconds]
05:44 -!- sacho [~sacho@95-42-65-214.btc-net.bg] has quit [Ping timeout: 245
seconds]
06:00 -!- kregg [~chatzilla@c-76-102-52-104.hsd1.ca.comcast.net] has joined
#go-nuts
06:02 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
06:03 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Remote
host closed the connection]
06:03 -!- kregg [~chatzilla@c-76-102-52-104.hsd1.ca.comcast.net] has left #go-nuts
[]
06:03 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has joined #go-nuts
06:05 -!- gigatropolis [~chatzilla@c-76-102-52-104.hsd1.ca.comcast.net] has joined
#go-nuts
06:06 < gigatropolis> lost on line one: I typed in some code from an
example.  it has line time.Sleep() so I figure I need to import the package time,
but nothing I due works
06:06 < gigatropolis> do works
06:06 -!- mikespook [~mikespook@219.137.252.64] has quit [Ping timeout: 265
seconds]
06:07 < gigatropolis> how to import time package?
06:08 < gigatropolis> package "time" // why does this give me a syntax
error?
06:09 < chressie> probably the first line should be: package main
06:09 < chressie> and the next one: import "time"
06:10 < chressie> try the tutorial http://golang.org/doc/go_tutorial.html
06:11 < chressie> there, you get in touch with the language
06:12 < gigatropolis> :2: syntax error near "<string>"
06:13 < gigatropolis> import "time" gives this error.  This doesn't seem
right
06:20 < gigatropolis> the line "import time" works, but when the compiler
sees "time.Sleep()" it says undefined: time
06:21 -!- ronnyy [~quassel@p4FF1DBDB.dip.t-dialin.net] has joined #go-nuts
06:22 -!- mikespook [~mikespook@219.137.50.177] has joined #go-nuts
06:23 < chressie> look at this example: http://gist.github.com/548963
06:25 < gigatropolis> I get this error ":2: syntax error near
"<string>"' on the line import "time"
06:28 < chressie> you need to: 6g test.go && 6l test.6
06:28 < chressie> or on 386: 8g test.go && 8l test.8
06:28 < chressie> and a recent version of go..
06:29 < gigatropolis> i'm doing 8g test.go but have yet to get it to
compile.  the version is a week old at most
06:34 < gigatropolis> chressie: got it.  was actually using 6g on accident
so it couldn't compile
06:34 < gigatropolis> thanks
06:34 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
06:50 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has quit
[Quit: Ex-Chat]
06:54 -!- jackman [~jackman@c-67-189-24-232.hsd1.or.comcast.net] has joined
#go-nuts
06:54 -!- ExtraSpice [~XtraSpice@88.118.32.225] has joined #go-nuts
06:56 < chressie> gigatropolis: np :)
07:07 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode]
07:07 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
07:08 -!- justindp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has left #go-nuts []
07:09 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has joined #go-nuts
07:15 -!- photron [~photron@port-92-201-96-187.dynamic.qsc.de] has joined #go-nuts
07:15 -!- boredomist [~boredomis@24.115.43.39.res-cmts.sesp.ptd.net] has quit
[Quit: Leaving]
07:15 -!- i__ [~none@69.164.206.224] has quit [Quit: leaving]
07:16 -!- i__ [~none@unaffiliated/i--/x-3618442] has joined #go-nuts
07:17 -!- Thorn_ [~thorn@unaffiliated/thorn] has joined #go-nuts
07:20 -!- Thorn [~thorn@unaffiliated/thorn] has quit [Ping timeout: 240 seconds]
07:36 -!- ikaros [~ikaros@188.107.58.178] has joined #go-nuts
07:36 -!- tvw [~tv@e176003012.adsl.alicedsl.de] has joined #go-nuts
07:44 -!- smw [~smw@c-76-28-90-0.hsd1.ct.comcast.net] has quit [Ping timeout: 240
seconds]
07:45 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
07:58 -!- General13372 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has joined
#go-nuts
08:01 -!- General1337 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has quit
[Ping timeout: 245 seconds]
08:05 -!- cmpitg [~cmpitg@113.22.127.75] has joined #go-nuts
08:08 -!- ubitux [~ubitux@did75-20-88-183-34-32.fbx.proxad.net] has joined
#go-nuts
08:08 < ubitux> hi
08:11 < ubitux> is there a way to stack slice elements on call?  something
like f(t[1:4]) and f(a string, b string, …
08:14 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
08:19 -!- sahid [~sahid@LNeuilly-152-21-22-10.w193-253.abo.wanadoo.fr] has joined
#go-nuts
08:25 -!- ikaros [~ikaros@188.107.58.178] has quit [Quit: Leave the magic to
Houdini]
08:27 < yiyus> ubitux: i'm not sure i understood your question...
08:27 < yiyus> do you want to pass a []string to a function f(...string)?
08:27 < ubitux> I have a function f(a string, b string)
08:27 < ubitux> and a want to send a [2]string
08:27 < ubitux> or a slice
08:28 < yiyus> well, then just do f(s[0], s[1])
08:28 < ubitux> but I don't want to do f(string[0], string[1]), etc
08:28 < yiyus> why?
08:28 < ubitux> I found it heavy
08:28 < ubitux> I have 5 args in fact
08:29 < yiyus> if you have a function with 5 arguments you have to pass it 5
arguments, i don't think there is any other way to do it
08:30 < ubitux> ok too bad
08:31 < yiyus> i proposed that you were able to do f(range s[0:4]), but it
look like that would bring too many complications
08:32 < ubitux> mmh
08:32 < ubitux> what kind?
08:33 < yiyus> you can read the thread in go-nuts, the subject is "using
range to pass ...  parameters"
08:33 < yiyus> i don't really know how you would implement it, or how it
would look like in the implementation
08:34 < yiyus> so, i just accepted the opinion of better informed people
08:34 < yiyus> s/implementation/specification/, sorry
08:35 -!- dolo [~dolo@210-84-26-83.dyn.iinet.net.au] has joined #go-nuts
08:41 -!- Shyde [~shyde@HSI-KBW-078-043-070-132.hsi4.kabel-badenwuerttemberg.de]
has joined #go-nuts
08:41 < ubitux> ok ok :)
08:41 < ubitux> thanks
08:55 -!- MizardX [~MizardX@unaffiliated/mizardx] has left #go-nuts []
08:55 -!- MizardX [~MizardX@unaffiliated/mizardx] has joined #go-nuts
08:57 < MizardX> yiyus: I have a suggestion to get around the problem: func
foo(args ...string) { return fooArr(args); } func fooArr(args []string) { /* do
some work */ }
09:01 < MizardX> (...  forgot the return type)
09:08 -!- sacho [~sacho@213.91.244.15] has joined #go-nuts
09:15 -!- Xurix [~Luixsia@AToulouse-254-1-2-166.w83-203.abo.wanadoo.fr] has quit
[Ping timeout: 245 seconds]
09:33 -!- tvw [~tv@e176003012.adsl.alicedsl.de] has quit [Remote host closed the
connection]
09:33 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Quit: WeeChat
0.3.2]
09:39 -!- ronnyy [~quassel@p4FF1DBDB.dip.t-dialin.net] has quit [Remote host
closed the connection]
09:39 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
09:40 -!- mikespook [~mikespook@219.137.50.177] has quit [Quit: Leaving.]
09:46 -!- Nexoro [~nexo@c-71-192-75-183.hsd1.ma.comcast.net] has joined #go-nuts
09:48 -!- cmpitg [~cmpitg@113.22.127.75] has quit [Quit: Ex-Chat]
09:48 < yiyus> MizardX: in fact my "problem" was the opposite, i wanted to
pass an slice to a variadic function
09:48 < yiyus> i cannot change that function (MultiReader), because it is
part of the library
09:48 < yiyus> but there is already a way to do it
09:49 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
09:50 < yiyus> func f(a []T){return func(b ...T) b{b = a; return
varfunc(b)}()}
09:51 < yiyus> (it looks very bad in a line, and could have some typo)
10:00 -!- virtualsue [~chatzilla@nat/cisco/x-gyujxkpjpnopkjwa] has joined #go-nuts
10:02 < ubitux> i have a type T which is a struct of 2 elements, and i'd
like to declare something like that: var t = []T {{"hello",3},{"foo",4},{"bar",1}}
but the syntax does no seem correct
10:02 < ubitux> where am i wrong?
10:02 < ubitux> (const if possible)
10:03 < nsf> var t = []T{T{"hello", 3}, T{"foo", 4}}
10:03 < ubitux> mmh oh ok
10:04 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
10:05 < ubitux> thanks :)
10:08 -!- Shyde [~shyde@HSI-KBW-078-043-070-132.hsi4.kabel-badenwuerttemberg.de]
has quit [Remote host closed the connection]
10:18 -!- gigatropolis [~chatzilla@c-76-102-52-104.hsd1.ca.comcast.net] has quit
[Ping timeout: 265 seconds]
10:18 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 265 seconds]
10:25 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
10:26 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
10:33 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Remote host closed the
connection]
10:34 -!- path[l] [~path@59.162.86.164] has quit [Quit: path[l]]
10:35 -!- path[l] [~path@59.162.86.164] has joined #go-nuts
10:36 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
10:37 -!- path[l] [~path@59.162.86.164] has quit [Client Quit]
10:38 -!- path[l] [~path@122.182.0.38] has joined #go-nuts
10:54 -!- sladegen [~nemo@unaffiliated/sladegen] has quit [Ping timeout: 245
seconds]
10:56 -!- sladegen [~nemo@unaffiliated/sladegen] has joined #go-nuts
11:09 -!- rlab [~Miranda@91.200.158.34] has quit [Ping timeout: 265 seconds]
11:11 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
11:30 -!- artefon [~thiagon@150.164.2.20] has joined #go-nuts
11:39 -!- artefon [~thiagon@150.164.2.20] has quit [Quit: Leaving]
11:40 -!- artefon [~thiago@dhcp19.usuarios.dcc.ufmg.br] has joined #go-nuts
11:49 -!- b4|hraban [~b4@a83-163-41-120.adsl.xs4all.nl] has quit [Quit: Leaving]
11:50 -!- jmettraux [~jmettraux@PPPbm5391.kanagawa-ip.dti.ne.jp] has joined
#go-nuts
12:01 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
12:01 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 260 seconds]
12:03 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
12:08 -!- path[l] [~path@122.182.0.38] has quit [Quit: path[l]]
12:18 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Ping timeout: 252 seconds]
12:22 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has joined #go-nuts
12:23 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has quit [Ping timeout: 276
seconds]
12:29 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 276 seconds]
12:32 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has joined #go-nuts
12:41 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has joined #go-nuts
12:44 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has quit [Ping timeout: 255
seconds]
12:47 -!- saschpe [~quassel@mgdb-4d0cfcb1.pool.mediaWays.net] has joined #go-nuts
12:53 -!- ivan` [~ivan@unaffiliated/ivan/x-000001] has joined #go-nuts
12:58 -!- plainhao [~plainhao@mail.xbiotica.com] has joined #go-nuts
13:00 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
13:02 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has joined #go-nuts
13:12 -!- \\localhost [~\\localho@quanthouse.cust.jaguar-network.net] has joined
#go-nuts
13:12 -!- ampleyfly [ampleyfly@free.blinkenshell.org] has joined #go-nuts
13:15 -!- noch [d4494a1c@gateway/web/freenode/ip.212.73.74.28] has quit [Ping
timeout: 252 seconds]
13:16 -!- path[l] [UPP@120.138.102.50] has joined #go-nuts
13:20 -!- visof [~visof@unaffiliated/visof] has quit [Quit: Leaving]
13:24 -!- artefon [~thiago@dhcp19.usuarios.dcc.ufmg.br] has quit [Ping timeout:
265 seconds]
13:26 -!- iant [~iant@adsl-71-133-8-30.dsl.pltn13.pacbell.net] has quit [Quit:
Leaving.]
13:30 < \\localhost> Hello there, can someone point me to a paper which
describes a basic plugin system in go language ? (i mean dynamic loading of
libraries, or maybe interprocess communication ?)
13:31 < napsy> \\localhost:
http://code.google.com/p/go/wiki/CallingWindowsDLLs
13:32 < \\localhost> oh, i've been searching for plugins and modules and
hasn't find anything, thanks you napsy
13:32 < napsy> you're welcome
13:32 < taruti> \\localhost: there are two working approaches: 1) external
processes and pipes (e.g.  chrome plugins work like this), 2) load shared
libraries (dirty), 3) just relink your executable when configuration changes (e.g.
xmonad does this)
13:32 < taruti> s/two/three
13:35 < \\localhost> taruti: i see, i would like to know more about external
processes and pipes since it seems the clean way to do this (i guess it's more
safe if there is a bug in the module) taruti
13:36 < taruti> so just use pipes and forkexec
13:37 -!- artefon [~thiago@dhcp19.usuarios.dcc.ufmg.br] has joined #go-nuts
13:38 < \\localhost> taruti: gonna rtfm, thx
13:38 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has joined #go-nuts
13:43 -!- iant [~iant@66.109.106.2] has joined #go-nuts
13:43 -!- mode/#go-nuts [+v iant] by ChanServ
13:45 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
13:46 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has quit [Client
Quit]
13:46 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
13:51 -!- femtoo [~femto@95-89-197-53-dynip.superkabel.de] has joined #go-nuts
14:04 -!- tvw [~tv@212.79.9.150] has quit [Ping timeout: 265 seconds]
14:10 -!- ericvh [~ericvh@32.97.110.63] has joined #go-nuts
14:13 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
14:17 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
14:18 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
14:25 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
14:27 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit:
Leaving]
14:33 -!- Makoryu [~vt920@pool-71-174-191-10.bstnma.fios.verizon.net] has joined
#go-nuts
14:37 -!- skelterjohn [~jasmuth@c-76-116-182-139.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
14:37 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Ping timeout: 240
seconds]
14:39 -!- skelterjohn [~jasmuth@c-76-116-182-139.hsd1.nj.comcast.net] has joined
#go-nuts
14:44 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has quit [Ping timeout:
260 seconds]
15:00 -!- iant [~iant@66.109.106.2] has quit [Quit: Leaving.]
15:02 < plexdev> http://is.gd/eD2U3 by [Russ Cox] in go/src/pkg/go/doc/ --
go/doc: use correct escaper for URL
15:03 -!- skelterjohn [~jasmuth@c-76-116-182-139.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
15:07 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:11 -!- Venom_X [~pjacobs@71.21.124.111] has joined #go-nuts
15:13 -!- jmettraux [~jmettraux@PPPbm5391.kanagawa-ip.dti.ne.jp] has quit [Remote
host closed the connection]
15:14 -!- iant [~iant@nat/google/x-kxfimtzejxbxmqmg] has joined #go-nuts
15:14 -!- mode/#go-nuts [+v iant] by ChanServ
15:21 -!- zaero [~eclark@valkyrie.buick455.com] has joined #go-nuts
15:23 -!- bortzmeyer [~bortzmeye@batilda.nic.fr] has quit [Quit: Leaving.]
15:23 -!- kanru [~kanru@118-168-238-233.dynamic.hinet.net] has joined #go-nuts
15:27 -!- slashus2 [~slashus2@74-137-24-74.dhcp.insightbb.com] has quit [Quit:
slashus2]
15:30 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts
15:41 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
15:42 -!- cco3 [~conley@c-69-181-138-209.hsd1.ca.comcast.net] has quit [Ping
timeout: 265 seconds]
15:44 -!- femtoo [~femto@95-89-197-53-dynip.superkabel.de] has quit [Quit:
Leaving]
15:45 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
15:45 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
16:02 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 276 seconds]
16:04 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
16:04 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
16:06 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Remote host closed
the connection]
16:08 -!- araujo [~araujo@gentoo/developer/araujo] has joined #go-nuts
16:09 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
16:15 -!- \\localhost [~\\localho@quanthouse.cust.jaguar-network.net] has quit
[Quit: WeeChat 0.3.0]
16:16 -!- ikaros [~ikaros@188.107.221.245] has joined #go-nuts
16:22 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
16:23 -!- kanru [~kanru@118-168-238-233.dynamic.hinet.net] has quit [Ping timeout:
240 seconds]
16:29 -!- virtualsue [~chatzilla@nat/cisco/x-gyujxkpjpnopkjwa] has quit [Ping
timeout: 265 seconds]
16:31 -!- nighty^ [~nighty@x122091.ppp.asahi-net.or.jp] has quit [Quit: Disappears
in a puff of smoke]
16:32 -!- Venom_X [~pjacobs@71.21.124.111] has quit [Quit: Venom_X]
16:39 -!- Venom_X [~pjacobs@71.21.124.111] has joined #go-nuts
16:44 -!- Xurix [~Luixsia@AToulouse-254-1-14-62.w83-203.abo.wanadoo.fr] has joined
#go-nuts
16:47 -!- idr0 [~idr@e179151075.adsl.alicedsl.de] has joined #go-nuts
16:49 < plexdev> http://is.gd/eDduy by [Andrew Gerrand] in go/ -- A+C:
Martin Neubauer
16:50 < plexdev> http://is.gd/eDduC by [Martin Neubauer] in go/src/pkg/ --
src/pkg/Makefile: delete use of QUOTED_GOBIN
16:51 -!- idr0 [~idr@e179151075.adsl.alicedsl.de] has quit [Remote host closed the
connection]
16:51 -!- femtoo [~femto@95-89-197-53-dynip.superkabel.de] has joined #go-nuts
16:52 -!- Venom_X_ [~pjacobs@66.54.185.131] has joined #go-nuts
16:52 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has joined #go-nuts
16:56 -!- Venom_X [~pjacobs@71.21.124.111] has quit [Ping timeout: 258 seconds]
17:00 -!- path[l] [UPP@120.138.102.50] has quit [Ping timeout: 240 seconds]
17:00 -!- path[l] [UPP@120.138.102.50] has joined #go-nuts
17:00 -!- bjarneh [~bjarneh@1x-193-157-197-144.uio.no] has joined #go-nuts
17:01 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has joined #go-nuts
17:04 -!- ikaros [~ikaros@188.107.221.245] has quit [Quit: Leave the magic to
Houdini]
17:04 -!- ikaros [~ikaros@188.107.221.245] has joined #go-nuts
17:04 -!- bjarneh [~bjarneh@1x-193-157-197-144.uio.no] has quit [Client Quit]
17:04 -!- bjarneh [~bjarneh@1x-193-157-197-144.uio.no] has joined #go-nuts
17:05 -!- virtualsue [~chatzilla@nat/cisco/x-vbyycrvnjmlxflob] has joined #go-nuts
17:06 < plexdev> http://is.gd/eDeWA by [Russ Cox] in go/ -- A+C: Jukka-Pekka
Kekkonen (individual CLA)
17:07 < plexdev> http://is.gd/eDeWH by [Jukka-Pekka Kekkonen] in
go/src/pkg/websocket/ -- websocket: fix missing Sec-WebSocket-Protocol on server
response.
17:09 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 276 seconds]
17:10 -!- gdhagger [~graham@199.4.20.12] has joined #go-nuts
17:13 -!- ikaros [~ikaros@188.107.221.245] has quit [Quit: Leave the magic to
Houdini]
17:13 -!- saschpe [~quassel@mgdb-4d0cfcb1.pool.mediaWays.net] has quit [Remote
host closed the connection]
17:16 -!- ikaros [~ikaros@188.107.221.245] has joined #go-nuts
17:21 -!- ExtraSpice [~XtraSpice@88.118.32.225] has quit [Quit: Leaving]
17:22 -!- ikaros [~ikaros@188.107.221.245] has quit [Quit: Leave the magic to
Houdini]
17:30 -!- ikaros [~ikaros@188.107.221.245] has joined #go-nuts
17:30 -!- macroron [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts
17:34 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
17:39 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
17:39 -!- RobertLJ [~quassel@c-68-44-163-191.hsd1.nj.comcast.net] has joined
#go-nuts
17:42 -!- artefon [~thiago@dhcp19.usuarios.dcc.ufmg.br] has quit [Ping timeout:
265 seconds]
17:46 -!- sacho [~sacho@213.91.244.15] has quit [Quit: Ex-Chat]
17:48 -!- rup [Rupert@deathcoil.net] has quit [Read error: Operation timed out]
17:51 -!- bjarneh [~bjarneh@1x-193-157-197-144.uio.no] has quit [Remote host
closed the connection]
17:57 -!- RobertLJ [~quassel@c-68-44-163-191.hsd1.nj.comcast.net] has quit [Remote
host closed the connection]
17:57 -!- jonny [~jonny@host81-158-79-35.range81-158.btcentralplus.com] has joined
#go-nuts
18:05 -!- Venom_X [~pjacobs@66.54.185.131] has joined #go-nuts
18:08 -!- enherit [~enherit@cpe-98-149-170-48.socal.res.rr.com] has joined
#go-nuts
18:08 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
18:10 -!- ucasano [~ucasano@host153-182-static.227-95-b.business.telecomitalia.it]
has quit [Quit: ucasano]
18:11 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
18:17 -!- mattikus [~mattikus@wireless-lsusecure-4.net.lsu.edu] has joined
#go-nuts
18:23 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit [Ping timeout:
240 seconds]
18:23 -!- navigator [~navigator@p54892D3B.dip.t-dialin.net] has joined #go-nuts
18:25 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has joined #go-nuts
18:25 < raylu> i'm trying to build http://github.com/fluffle/goirc/ and i'm
stuck on these errors: https://pastee.org/p7unz
18:25 -!- Guest55253 [~jonny@host81-158-79-35.range81-158.btcentralplus.com] has
quit [Remote host closed the connection]
18:30 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
18:31 < exch> WriteString probably returns the number of bytes sent, as well
as a possible error
18:31 < exch> You'd have to check the docs for that particular type/function
18:32 -!- sacho [~sacho@95-42-65-214.btc-net.bg] has joined #go-nuts
18:33 < exch> I' guessing 'io' is a bufio.Writer implementation..  It's
signature is indeed: func (b *Writer) WriteString(s string) (int, os.Error)
18:33 < exch> In which case like 15 should read: n, err :=
conn.io.WriteString(..)
18:33 < exch> *line
18:34 -!- rup [Rupert@deathcoil.net] has joined #go-nuts
18:34 -!- napsy [~luka@212.235.174.112] has quit [Read error: Operation timed out]
18:36 -!- Makoryu [~vt920@pool-71-174-191-10.bstnma.fios.verizon.net] has left
#go-nuts ["Absquatulandus sum"]
18:37 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
18:37 -!- sladegen [~nemo@unaffiliated/sladegen] has quit [Disconnected by
services]
18:38 -!- sladegen [~nemo@unaffiliated/sladegen] has joined #go-nuts
18:39 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Quit:
skelterjohn]
18:41 -!- aho [~nya@fuld-4d00d08d.pool.mediaWays.net] has joined #go-nuts
18:41 < raylu> exch: ah.  thanks!
18:41 < nickaugust> hey im getting this error: "implicit assignment of
unexported field 'count' of llrb.Tree in function argument" when calling this
function "func index(index Index, tree llrb.Tree)" like this "index(&Contact{},
contactIndex)" code snippet here http://sprunge.us/jXeR
18:41 < nickaugust> any ideas?
18:43 <+iant> count is a private field; you are implicitly copying it by
passing the value to a function
18:43 <+iant> if you manipulate a struct with a private field in a different
package, you pretty much have to use a pointer
18:44 < nickaugust> ah its passed by value...  yes ok i see now.  thanks
iant
18:45 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Remote host closed the
connection]
18:48 < taruti> the "some values are pointers and some have to be passed by
pointer" is quite annoying
18:48 -!- boredomist [~boredomis@24.115.43.39.res-cmts.sesp.ptd.net] has joined
#go-nuts
18:48 * taruti wonders from time to time whether to do a "type Public *private" or
not
18:49 -!- mattikus [~mattikus@wireless-lsusecure-4.net.lsu.edu] has quit [Quit:
Computer has gone to sleep.]
18:50 < raylu> i'm still rather confused about how to use packages in a
subdirectory.  without installing the package, is there a way to import
"./goirc/irc", for example?
18:55 < chressie> raylu: yes, import "./goirc/_obj/irc" should work..
18:55 < nsf> raylu: package is just an .a file you can copy it to a folder
where your .go files are
18:56 < nsf> and use it like "./goirc" and it will point to goirc.a file
18:56 <+iant> the main catch is that every .go file which imports the
package needs to use the same file name in the import statement
18:56 <+iant> so if you import "./goirc/_obj/irc" once, then you need to use
that for each package which does that import
18:56 < nsf> uhm..  why?
18:57 <+iant> it is a consequence of the fact that you can have multiple
packages with the same name, as long as they have different file names
18:57 <+iant> that is, you can have multiple packages named "p"
18:57 <+iant> they are distinguished by the file name used to import them
18:58 < nsf> and if I import the same package but using different file names
it will be linked twice?
18:58 <+iant> right
18:58 < nsf> interesting
18:58 <+iant> which can be OK in some limited cases, but is generally not
ideal
18:58 < nsf> I thought linker can handle that kind of thing
18:59 <+iant> it does handle it; it handles it by renaming based on the file
name used in the import
18:59 < raylu> ok.  the default makefile seems to make the _obj and move
things there
18:59 < raylu> is there a way to build it so that i can avoid such an ugly
import statement?
18:59 < raylu> or, actually, i've already built it that way
18:59 < raylu> is there a reason i should stick to the _obj/ directories?
18:59 < nsf> raylu: sure, just tweak that in your makefile
18:59 < nsf> wait a sec I'll give you an example how I use it
18:59 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
18:59 < raylu> er, like i said, i've already done it
19:00 < raylu> but is there a reason to keep the _obj directories?
19:00 < nsf> configfile.a: goconfig/configfile.go
19:00 < nsf> gomake -C goconfig
19:00 < nsf> cp goconfig/_obj/configfile.a .
19:00 < nsf> I mean simply copy that resulting file whatever you want to
19:00 < nsf> and then import it using nice name instead of ugly name :)
19:01 < nsf> works for me
19:01 < raylu> well, eventually, i want to distribute this to others
19:01 < nsf> it's a build system issue completely
19:01 < nsf> and..  what's the problem with that?
19:02 < raylu> my current directory structure is
19:02 < raylu> i have my irc client code in the root with a directory for
goirc
19:02 < raylu> should i have the makefile at the root build goirc and copy
the object file out?
19:02 < chressie> raylu: maybe you can use goinstall and then: import
"github.com/jessta/goirc/irc"
19:02 < nsf> raylu: sure, why not
19:02 < nsf> that's what I do
19:02 -!- slpsys_ [~marc@209-20-75-46.slicehost.net] has left #go-nuts []
19:02 < raylu> what does goinstall do?
19:03 < nsf> and I don't think that goinstall is a better thing
19:03 < nsf> its use is really limited
19:03 < chressie> checks out sources, compiles and places them in "standard
lib path"
19:03 < raylu> oh, i see...
19:03 < nsf> it doesn't have versioning, it can't handle cgo packages, etc.
19:04 < Namegduf> Lack of versioning is rather a killer
19:04 < raylu> yeah, i'd prefer to not install stuff into $GOROOT by default
19:04 < nsf> but if you include the lib in your tree, you're fine
19:04 < Namegduf> It makes running different branches a complete pain
19:04 < raylu> well thanks.  i'll have another poke at this when i get back
19:05 < Namegduf> And means that unless you control maintenance, things are
going to continuously randomly break in actual usage during the delay between
upstream changing and you syncing.
19:05 < nsf> raylu: btw, this example of the makefile is from the real
project, you can check it out here: http://github.com/nsf/gocode
19:05 < nsf> config.go file here, uses external package called configfile.a
19:06 < nsf> and I keep it under goconfig dir
19:06 < nsf> I mean simply 'configfile', without .a
19:06 < nsf> it's just a name of the archive package :)
19:08 < nickaugust> if a struct has been passed to a function as an
interface can you access properties of the struct that are not in the interface
definition?
19:10 < nickaugust> does that make sense?
19:10 < nsf> nope
19:10 < nsf> unless you know the type of that struct
19:10 < nickaugust> i do
19:10 < nsf> and can type assert interface to that type
19:10 < nsf> before using it
19:11 < nickaugust> yes ok let me try that.  thanks nsf
19:12 < Namegduf> Bear in mind that type assertions are unsafe.
19:12 < Namegduf> In the sense that their correction is your job to ensure.
19:12 < Namegduf> *correctness
19:12 < nsf> they are very safe
19:12 < nsf> they are as safe as nil pointers
19:13 < Namegduf> That's not "very safe"
19:13 < nsf> buffer overflow is unsafe, null ptr deref in C is unsafe, but
Go checks all these things anyway
19:14 < nsf> and throws panics
19:14 < Namegduf> That does not make them safe.
19:14 < nsf> using unsafe.Pointer is unsafe
19:14 < nickaugust> is there a 'type type' or a way to pass the type as an
argument to the function and then use it like index.(typeVar).property
19:14 < Namegduf> Yes, it is.
19:14 < nsf> and unsafe package in general
19:14 < nsf> everything else is safe
19:14 < Namegduf> No.
19:14 < nsf> No is not an argument
19:15 < Namegduf> What is your definition of "safe"?
19:15 < nsf> :)
19:15 < nsf> something that doesn't break my app, doesn't corrupt my memory,
etc.
19:15 < Namegduf> Okay, that's similar to mine.
19:16 < Namegduf> So you're saying that without using unsafe, it is
IMPOSSIBLE for your app to be broken?
19:16 < nsf> yes, silently it won't contain that kind of errors, only logic
ones
19:16 < Namegduf> "that kind of errors"
19:16 < Namegduf> You didn't mention any specific kind of error in your
definition of "safe".
19:16 < nsf> memory corruption
19:17 < Namegduf> You also said "break my app", which includes a much wider
range of errors.
19:17 < nsf> but I agree "break my app" is a bit too abstract
19:18 < Namegduf> I consider anything "unsafe" that a programmer has to
ensure the correctness of, and the only part of the program which is by default
"safe" the type system
19:18 < nsf> but that's because we don't have a clear definition of "safe"
19:18 < Namegduf> Because the compiler enforces the correctness there.
19:18 < Namegduf> Type assertions, however, do not have their correctness
enforced, just as unsafe does not.
19:18 < nsf> I think that programmer has to ensure the correctness of
everything he/she writes
19:18 < Namegduf> Generally, yes, but the compiler can ensure correctness of
certain things.
19:19 < nsf> because if input is incorrect, it leads to errors, if there is
an int overflow, it leads to errors, etc.
19:19 < Namegduf> That's what type safety is for.
19:19 < nsf> but type assertion is type safe
19:19 < nsf> because interface knows the real type
19:19 < Namegduf> It can be, if you check the type rather than simply
asserting it.
19:19 < nsf> whether you check for it or not it's your problem
19:20 < nsf> yes
19:20 < nsf> but if you don't then the go runtime will throw a panic for you
19:20 < nsf> because it checks for type correctness anyway
19:20 < Namegduf> Right, but that breaks my app.
19:20 < nsf> as well as for nil pointers, etc.
19:20 < Namegduf> Not safe.
19:21 < nsf> it is safe :)
19:21 < Namegduf> Nil pointers are not safe, but this isn't news because the
compiler is not supposed to ensure they are.
19:21 < nsf> compiler checks every pointer dereference
19:21 < nsf> unlike C does
19:21 < Namegduf> They can't cause memory corruption, but that does not mean
they do not cause errors.
19:22 < Namegduf> There's multiple definitions of safe, and I think we need
to try to stick with one at once.
19:22 -!- Fish [~Fish@9fans.fr] has quit [Remote host closed the connection]
19:22 < nsf> ugh..  as I said integer overflows cause errors too
19:22 < nsf> if you're not careful
19:22 -!- Fish [~Fish@9fans.fr] has joined #go-nuts
19:22 < Namegduf> Right.  Those are also not safe.
19:22 < nsf> integers are not safe?
19:22 < Namegduf> Why would you expect them to be?
19:22 < nsf> then we're playing with a very dangerous language :)
19:23 < Namegduf> Right.
19:23 < nsf> I don't see a point to define safety that way
19:23 < Namegduf> Because type safety is an exception.
19:23 < Namegduf> You can't get types wrong.
19:23 < Namegduf> The compiler will not let you.
19:23 < Namegduf> Unless you do type assertions or use unsafe, in which case
the validity of whatever you're doing and any necessary safety checks are your
responsibility.
19:23 < nsf> yes, but type safety is provided by the fact that you have type
information
19:24 < nsf> if you're using it you're safe
19:24 < nsf> if not, then it's your problem
19:24 < Namegduf> That does not mean that type information implies type
safety
19:24 < Namegduf> Type safety is provided by the compiler not permitting
incorrect types to be used where a different type is expected.
19:25 < Namegduf> Type information implements that, but it doesn't imply
that.
19:25 < nsf> ugh, yes..  and it does that in case of fail type assertion
19:25 < nsf> it stops execution and throws panic
19:25 < Namegduf> That's not what I would consider a safe outcome.
19:25 < nsf> I consider it as unexpected behaviour that can be handled if
necessary
19:26 < nickaugust> nsf: how do I do a type assertion in that situation?  I
tried to acces the field like this "index.(Contact).Company" but i get runtime
panic "panic: interface conversion: main.Index is *main.Contact, not main.Contact"
19:26 < nsf> Namegduf: you see!
19:26 < Namegduf> nickaugust: You need to cast it to *Contact, not Contact.
19:26 < nickaugust> hm
19:26 < nsf> compiler doesn't allow nickaugust to use the interface as a
wrong type
19:26 < Namegduf> Er, no
19:26 < Namegduf> The RUNTIME does not.
19:26 < nsf> runtime is a part of a compiler
19:26 < Namegduf> No, it isn't.
19:26 < nsf> lol
19:27 < Namegduf> The runtime is compiled in by the compiler
19:27 < nsf> compiler can't work without runtime
19:27 < nsf> because it generates runtime calls
19:27 < nsf> at certain points
19:27 < nsf> like type assertions
19:27 < Namegduf> Compiler can't work without the OS kernel
19:27 < nsf> etc.
19:27 < Namegduf> That does not make the kernel part of the compiler,.
19:27 < nickaugust> hehehe you two
19:28 < nsf> well, ok, you're right
19:28 < nsf> but that's not even the point
19:28 < Namegduf> At any rate, the real significant difference is, for my
definition
19:28 < Namegduf> That type safety at compile time prevents the error
reaching runtime and thus the app being broken
19:29 < Namegduf> While throwing panics at runtime does not prevent the app
breaking.
19:29 < nsf> it gives you an ability to handle failures
19:29 < nsf> and this is my definition of safety
19:29 < nsf> being in control of things
19:30 < Namegduf> So you consider assembly the most safe language in
existence?
19:30 < nsf> sure
19:30 < Namegduf> Okay.  I don't share that definition.
19:31 < nsf> in assembly every error is a logic error, because it operates
in a very simple set of terms
19:31 < Namegduf> But, since it's contentious, I'll reduce my statement to
"Bear in mind that you need to ensure that type assertions are valid yourself, or
that behaviour if they aren't is acceptable, as the compiler cannot do it for you
at compile time."
19:31 < nsf> well, I agree with you actually
19:32 < nsf> that's why I said
19:32 < nsf> nsf | unless you know the type of that struct
19:32 < nsf> so if you really know the type of a struct in the interface you
can do any sort of type assertion
19:34 -!- angasule [c80571ea@gateway/web/freenode/ip.200.5.113.234] has joined
#go-nuts
19:38 < nickaugust> can I pass *Contact to the function?  what type would
that be?
19:38 < nickaugust> func index(c struct)?  something like that
19:38 < nickaugust> then do the assert like index.(c).property
19:38 < nickaugust> ?
19:40 < nsf> oh wait, we were arguing and forgot about you
19:40 < nsf> so..  you have a function
19:40 < nsf> like func MyFunc(a interface{})
19:40 < nickaugust> yes
19:40 < nsf> and then you're passing a variable of type *Contact (e.g.  a
pointer to the struct Contact)
19:41 < nsf> then you need to access its fields inside that function
19:41 < nickaugust> yes...  what type is that variable?
19:41 < nsf> you can do this:
19:41 < exch> arg.  todays go update broke my cgo packages D: Once more unto
the breach we go
19:41 < nsf> ptr := a.(*Contact)
19:41 < nsf> and then ptr has type *Contact
19:42 < nsf> but you can do that only if you're sure that 'a' has type
*Contact
19:42 < nsf> if not you can do a type assertion with check or type switch
19:42 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 276 seconds]
19:42 < nsf> like that:
19:42 < nsf> ptr, ok := a.(*Contact)
19:42 < nickaugust> so what type do i ask for in the function definition?
19:42 < nickaugust> myFunc(a interface{}, t struct)
19:43 < nsf> that's nonsense
19:43 < nsf> what are you trying to do?
19:43 < nickaugust> myFunc(a interface{}, t <what goes here?>)
19:43 < nsf> why do you want this?
19:44 < nsf> you need to do a dynamic dispatch inside myFunc based on the
real type of 'a' right?
19:45 < nickaugust> im not sure what you mean by dynamic dispatch
19:45 < nickaugust> im trying to access the properties from a struct that is
passed as an interface
19:45 < nsf> it means you want to execute different code for different types
of 'a'
19:45 < nickaugust> but in oder to do the assert i need to pass the type as
well
19:45 < nsf> no you don't
19:45 < nsf> interface contains a type information
19:45 < nickaugust> ok how do i get the type from interface?
19:46 < nsf> but I won't tell you unless I'll be sure that this is what you
want to do :)
19:46 < nickaugust> omlg :)
19:46 < exch> switch tt := a.(type) { case *Contact: tt.Somefield = foo;
tt.Dostuff(); }
19:46 < nsf> because using reflect package is most likely not what you're
looking for
19:47 < nsf> ok, let's suppose you can extract a type information from that
interface
19:47 < nickaugust> ok let me tell you what im doing
19:47 < nsf> but you still want to access a concrete field directly
19:47 < nsf> how can you do that if you're extracting the type at runtime
19:47 < nsf> you don't know what fields that type has
19:48 < nsf> or you do know what the type is?  :)
19:48 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
19:48 < nickaugust> yes because they are passed as argumetns to the fucntion
19:48 < nsf> so, you really want to access fields of an unknown structure
19:49 < nsf> that's kind of strange but ok
19:49 < nickaugust> func index( directory, data_models, index_fields)
19:49 < nickaugust> no i know the structure
19:49 < nickaugust> i want the same index function to work on different data
models
19:49 < nsf> but then
19:49 < nsf> why don't you provide a common interface
19:49 < nsf> for the "data model"
19:49 < nsf> which has all the accessors
19:50 < nickaugust> what do you mean by accessors?
19:50 < nsf> like interface DataModel { func SetField1(var int); func
GetField1() int; }
19:50 < nickaugust> the "data models" have different field names so i cant
include those in the interface
19:50 < nsf> but you can include that interface actually
19:50 < nsf> func SetFieldX(name string, value interface{})
19:50 < nsf> but it's ugly
19:51 < nsf> ok, if you really want to do this
19:51 < nsf> check out the "reflect" package
19:51 < nickaugust> hmmm..  i could do that i guess...  i dont see why its
better
19:51 < nsf> because the other way to do this
19:51 < nsf> is using the reflect package
19:51 < nsf> which is not very pleasant
19:52 < nsf> and is not very fast
19:53 < nbjoerg> grrr.  who commits regression tests that are ~infinite
loops
19:54 < nsf> nickaugust: using reflect package you can get a type of an
interface
19:54 < nsf> 'reflect.Typeof'
19:54 -!- ville- [~ville@a107.ath.cx] has quit [Ping timeout: 260 seconds]
19:54 < nsf> and then you can type assert that to a ptr type
19:54 < nsf> and then get a value that pointer points to
19:54 < nickaugust> why not a.(type)?
19:55 < nsf> and then investigate struct fields of that value
19:55 < nsf> I mean of the type of that value
19:55 < nsf> because a.(type) is a type switch statement
19:55 < nsf> it's valid only in that context
19:55 < nsf> is for*
19:56 < nsf> or I still don't understand what you want
19:56 < nsf> a full example can help
19:57 < nickaugust> nsf: hold on ive got a better understanding of this now
let me try a few things
19:57 < nsf> http://github.com/nsf/gocode/blob/master/config.go
19:57 < nsf> here is an example of 'reflect' usage
19:57 < nsf> I have an unknown "config" struct
19:58 < nsf> and a bunch of functions that write and read its fields
19:58 -!- femtoo [~femto@95-89-197-53-dynip.superkabel.de] has quit [Quit:
Leaving]
19:58 < nsf> to a config file
19:58 -!- General1337 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has joined
#go-nuts
19:58 < nsf> and it's a lot of code
19:59 < nsf> that does nothing
19:59 < nsf> (sort of)
19:59 < nsf> because for a current "config" struct that I have I can do the
same with 10-20 lines of code :D
20:01 -!- General13372 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has quit
[Ping timeout: 240 seconds]
20:02 < nsf> I hope it helps
20:02 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.3]
20:07 < nickaugust> exch: thnx "switch tt := a.(type) {..}" was what i
needed
20:08 -!- mattikus [~mattikus@wireless-lsusecure-14.net.lsu.edu] has joined
#go-nuts
20:09 -!- skelterjohn [~jasmuth@c-76-116-182-139.hsd1.nj.comcast.net] has joined
#go-nuts
20:17 -!- macroron [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit:
Leaving]
20:17 -!- ville- [~ville@a107.ath.cx] has joined #go-nuts
20:27 -!- ville- [~ville@a107.ath.cx] has quit [Ping timeout: 240 seconds]
20:30 -!- ville- [~ville@a107.ath.cx] has joined #go-nuts
20:32 -!- plainhao [~plainhao@mail.xbiotica.com] has quit [Quit: plainhao]
20:41 -!- ville- [~ville@a107.ath.cx] has quit [Ping timeout: 246 seconds]
20:43 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
20:45 -!- gdhagger [~graham@199.4.20.12] has quit [Quit: Ex-Chat]
20:58 -!- ville- [~ville@a107.ath.cx] has joined #go-nuts
21:00 -!- mattikus [~mattikus@wireless-lsusecure-14.net.lsu.edu] has quit [Quit:
Computer has gone to sleep.]
21:05 -!- mwarning [~mwarning@ip-78-94-206-255.unitymediagroup.de] has joined
#go-nuts
21:07 -!- Venom_X [~pjacobs@66.54.185.131] has quit [Quit: Venom_X]
21:07 -!- bjarneh [~bjarneh@96.89-10-27.nextgentel.com] has joined #go-nuts
21:17 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
21:22 -!- mwarning [~mwarning@ip-78-94-206-255.unitymediagroup.de] has left
#go-nuts []
21:24 -!- deso [~deso@x0561a.wh30.tu-dresden.de] has quit [Read error: Connection
reset by peer]
21:28 -!- navigator [~navigator@p54892D3B.dip.t-dialin.net] has quit [Quit:
WeeChat 0.3.3]
21:29 -!- justindp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has joined #go-nuts
21:31 -!- jdp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit [Ping timeout:
276 seconds]
21:39 -!- Fish [~Fish@9fans.fr] has quit [Remote host closed the connection]
21:47 -!- boscop_ [~boscop@g226251055.adsl.alicedsl.de] has joined #go-nuts
21:47 -!- boscop [~boscop@g225212036.adsl.alicedsl.de] has quit [Ping timeout: 240
seconds]
21:56 < plexdev> http://is.gd/eDEJG by [Russ Cox] in go/src/ -- build:
delete Make.386 Make.amd64 Make.arm
21:56 < plexdev> http://is.gd/eDEJJ by [Russ Cox] in go/lib/codereview/ --
codereview: really disable codereview when not available
21:56 < plexdev> http://is.gd/eDEK8 by [Russ Cox] in go/src/libcgo/ --
libcgo: update Makefile to use Make.inc
21:56 < plexdev> http://is.gd/eDEKo by [Russ Cox] in 3 subdirs of go/src/ --
build: let pkg/Makefile coordinate building of Go commands
21:57 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
22:00 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
22:01 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:05 -!- aho [~nya@fuld-4d00d08d.pool.mediaWays.net] has quit [Ping timeout: 265
seconds]
22:05 -!- dolo [~dolo@210-84-26-83.dyn.iinet.net.au] has quit [Quit: HydraIRC
-> http://www.hydrairc.com <- *I* use it, so it must be good!]
22:07 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller,
Faster, Easier.  http://miranda-im.org]
22:12 -!- ericvh [~ericvh@32.97.110.63] has quit [Ping timeout: 240 seconds]
22:13 < plexdev> http://is.gd/eDGaw by [Russ Cox] in 2 subdirs of go/src/ --
gotest: allow make test of cgo packages (without make install)
22:13 < plexdev> http://is.gd/eDGaB by [Russ Cox] in go/src/cmd/goinstall/
-- goinstall: use https for Google Code checkouts
22:17 -!- General13372 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has joined
#go-nuts
22:18 -!- dju [dju@fsf/member/dju] has quit [Ping timeout: 240 seconds]
22:19 -!- gabriel9 [~gabriel9@93.157.192.28] has quit [Read error: Connection
reset by peer]
22:20 -!- General1337 [~support@71-84-244-55.dhcp.gldl.ca.charter.com] has quit
[Ping timeout: 240 seconds]
22:21 -!- gabriel9 [~gabriel9@93.157.192.28] has joined #go-nuts
22:26 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has joined
#go-nuts
22:30 -!- bjarneh [~bjarneh@96.89-10-27.nextgentel.com] has left #go-nuts []
22:30 -!- aho [~nya@fuld-4d00d371.pool.mediaWays.net] has joined #go-nuts
22:30 -!- photron [~photron@port-92-201-96-187.dynamic.qsc.de] has quit [Ping
timeout: 240 seconds]
22:34 -!- dju [dju@fsf/member/dju] has joined #go-nuts
22:37 -!- virtualsue [~chatzilla@nat/cisco/x-vbyycrvnjmlxflob] has quit [Ping
timeout: 265 seconds]
22:39 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has quit [Remote host
closed the connection]
22:40 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has joined #go-nuts
22:40 -!- mattn_jp [~mattn_jp@180-144-131-240.eonet.ne.jp] has quit [Remote host
closed the connection]
22:40 -!- awidegreen [~quassel@62.176.237.78] has quit [Remote host closed the
connection]
22:41 -!- dju [dju@fsf/member/dju] has quit [Ping timeout: 276 seconds]
22:42 -!- napsy [~luka@212.235.174.112] has quit [Ping timeout: 260 seconds]
22:45 -!- dju [dju@fsf/member/dju] has joined #go-nuts
22:48 -!- bjarneh [~bjarneh@96.89-10-27.nextgentel.com] has joined #go-nuts
22:56 -!- dju_ [dju@fsf/member/dju] has joined #go-nuts
22:57 -!- dju [dju@fsf/member/dju] has quit [Read error: Connection reset by peer]
23:00 -!- kanru [~kanru@118-160-164-153.dynamic.hinet.net] has joined #go-nuts
23:08 -!- adu [~ajr@pool-71-191-154-37.washdc.fios.verizon.net] has joined
#go-nuts
23:16 -!- mattikus [~mattikus@ip24-250-73-154.br.br.cox.net] has joined #go-nuts
23:25 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
23:28 -!- iant [~iant@nat/google/x-kxfimtzejxbxmqmg] has quit [Read error:
Operation timed out]
23:29 -!- jmettraux [~jmettraux@211.19.55.177] has joined #go-nuts
23:31 -!- napsy [~luka@212.235.174.112] has joined #go-nuts
23:34 -!- iant [~iant@66.109.106.2] has joined #go-nuts
23:34 -!- mode/#go-nuts [+v iant] by ChanServ
23:39 -!- iant [~iant@66.109.106.2] has quit [Ping timeout: 252 seconds]
23:45 -!- ikaros [~ikaros@188.107.221.245] has quit [Quit: Leave the magic to
Houdini]
23:50 -!- justindp [~gu@24.238.32.162.res-cmts.segr.ptd.net] has quit [Ping
timeout: 240 seconds]
23:52 -!- jcao219 [~jcao219@pool-173-74-61-111.dllstx.fios.verizon.net] has quit
[Ping timeout: 240 seconds]
23:56 -!- iant [~iant@216.239.45.130] has joined #go-nuts
23:56 -!- mode/#go-nuts [+v iant] by ChanServ
--- Log closed Thu Aug 26 00:00:05 2010