Re: [go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Darren Hoo
But static binary is way bigger than 10loc snippet, if I compile it to binary which is 6.7 megabytes in size on my laptop, and then scp to my server, it takes 10 minutes to upload meanwhile I can not do anything on the server because my network is saturated during uploading. The case with Simp

Re: [go-nuts] Re: go escape analysis

2016-09-29 Thread 'Axel Wagner' via golang-nuts
The only real rule is "when the compiler can prove, that it doesn't escape, it doesn't". There is no guarantee or fixed policy around escape analysis. If you are convinced that something doesn't escape and that the compiler should be able to figure it out, you can try filing an issue about that wit

Re: [go-nuts] calling go functions from c

2016-09-29 Thread webuser1200
Thanks for reading my question. I'm trying to map c to Go "C." C int -> go C.int C unsigned char -> ? C char -> ? C unsigned short -> ? C double -> ? C __int64 -> ? C *char -> C.string On Friday, September 30, 2016 at 1:27:13 AM UTC-4, Ian Lance Taylor wrote: > > On Thu, Sep 29, 2016 at 8:59 PM

Re: [go-nuts] calling go functions from c

2016-09-29 Thread Ian Lance Taylor
On Thu, Sep 29, 2016 at 8:59 PM, wrote: > I have a basic example working of calling back into go from C. If I have a C > function as: > > func Add(a, b C.Int) C.Int { > return a + b > } > > Where is the mapping of C type to C. when I want to pass additional > types to Go : > > 1. Unsigned int > 2

Re: [go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Harley Laue
Go does build as a static binary. However, if all you're doing in production is serving static files, nginx is a better solution. Python and SimpleHTTPServer isn't for production anyway. Best of luck in your deployment. Maybe you'll be able to find a use case for Go in your future endeavors. If not

[go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Darren Hoo
Sure, for my development environment, I can do all this.. But on a server with only Go installed, in order to use go get, I have to setup GOPATH, I have to installed git. And I have to cross the great firewall of china. Oh my god, thank you guys. forget what I said. Go is not built for doing

[go-nuts] calling go functions from c

2016-09-29 Thread webuser1200
I have a basic example working of calling back into go from C. If I have a C function as: func Add(a, b C.Int) C.Int { return a + b } Where is the mapping of C type to C. when I want to pass additional types to Go : 1. Unsigned int 2. char 3. double 4. string 5. short etc... -- You received

[go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Diego Medina
Hi, If you don't want to have to copy/paste that snippet of code on a new laptop/OS install, I have been using: $ go get github.com/rif/spark $ spark static_site/ for the last couple of years, works great, it's simple. https://github.com/rif/spark Regards, Diego On Thursday, September 29, 2

Re: [go-nuts] Re: go escape analysis

2016-09-29 Thread 刘桂祥
package main func main() { var m map[int]int { m = make(map[int]int) } _ = m } if I do this m will not escape just want to know what's the scope rule for escape ? puzzled

[go-nuts] Re: SimpleHttpServer built into go toolchain?

2016-09-29 Thread Dave Cheney
> Since Go is battery included and http is part of its core library, We said batteries, not the kitchen sink. But seriously, the standard library gives you the components to build these tools yourself. If the Go distro included a http server that just served static files, while this would be p

[go-nuts] SimpleHttpServer built into go toolchain?

2016-09-29 Thread Darren Hoo
One thing that I really like about python is this one command line to serve static files: python -m SimpleHTTPServer This is very convenient. Now I just want to use Go to do the same thing, I have to copy the snippet from https://github.com/golang/go/wiki/HttpStaticFiles and go run i

[go-nuts] Re: Getting a snapshot of point-in-time allocation

2016-09-29 Thread Caleb Spare
Of course now that I sent this email, I have just noticed this pprof flag: -baseShow delta from this profile I haven't tried it yet, but this seems like it might solve these problems. -Caleb On Thu, Sep 29, 2016 at 2:12 PM, Caleb Spare wrote: > pprof gives two kinds of heap profiles: (pl

[go-nuts] Getting a snapshot of point-in-time allocation

2016-09-29 Thread Caleb Spare
pprof gives two kinds of heap profiles: (please let me know if any of this is not correct) - inuse_space -- a profile of the currently live objects/bytes on the heap - alloc_space -- a profile of the allocated objects/bytes since program startup When I need to figure out why my heap is so big, in

[go-nuts] Re: I want a Gopher Squishable

2016-09-29 Thread Roberto Zanotto
They definitely were on the merchandise store, seems like they're sold out. No idea when they will be available again. Some big Go conferences give them away for free. On Thursday, September 29, 2016 at 8:58:47 PM UTC+2, Esteban Rodríguez Betancourt wrote: > > Hello! > I want to buy a gopher squi

Re: [go-nuts] Wordbreak and word extraction in Go?

2016-09-29 Thread 'Ingo Oeser' via golang-nuts
thx Marcel, filed an issue here: https://github.com/golang/go/issues/17256 if you could outline a possible designe there, that would be great. On Thursday, September 22, 2016 at 5:51:48 PM UTC+2, Marcel van Lohuizen wrote: > > Hi Ingo, > > Thanks for your interest in x/text! Text segmentation

Re: [go-nuts] why this?

2016-09-29 Thread 'Axel Wagner' via golang-nuts
On Thu, Sep 29, 2016 at 9:09 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Thu, 29 Sep 2016 19:35:49 +0200 > Axel Wagner wrote: > > [...] > > > With type assertions, I really fail to see how returning the zero > > > value for the target type in case the type assertion fai

Re: [go-nuts] why this?

2016-09-29 Thread Ian Lance Taylor
On Thu, Sep 29, 2016 at 12:08 AM, T L wrote: > > On Thursday, September 29, 2016 at 1:31:41 PM UTC+8, Ian Lance Taylor wrote: >> >> On Wed, Sep 28, 2016 at 10:02 PM, T L wrote: >> > >> > On Thursday, September 29, 2016 at 12:56:57 PM UTC+8, Micky wrote: >> >> >> >> The reason is directly stated i

Re: [go-nuts] why this?

2016-09-29 Thread Konstantin Khomoutov
On Thu, 29 Sep 2016 19:35:49 +0200 Axel Wagner wrote: [...] > > With type assertions, I really fail to see how returning the zero > > value for the target type in case the type assertion failed can be > > useful. > > > > For example: You are using context.Context, save a thing under a > given ke

[go-nuts] I want a Gopher Squishable

2016-09-29 Thread estebarb
Hello! I want to buy a gopher squishable, but in the Google Merchandise Store that item is not found (neither the T-shirts). Somebody knows where I could get one, or when it will be available again? I'm not sure if I should file a bug about that :p . Thanks, Esteban -- You received this messag

Re: [go-nuts] How to fork or create a subprocess?

2016-09-29 Thread Aram Hăvărneanu
You can't use fork in multithreaded programs (except to call exec), and all Go programs are multithreaded. You can use os/exec to start new programs, however. -- Aram Hăvărneanu -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

Re: [go-nuts] why this?

2016-09-29 Thread Henrik Johansson
I don't think it is based on the zero value being useful but a desire to be as exact as possible when working with unknown data. You reach for X when you have Y. Why would you magically get an X back? Panic can arguably be seen as too strong but the multiple return is awesome. On Thu, Sep 29, 2016

[go-nuts] How to fork or create a subprocess?

2016-09-29 Thread adam . greenhill
I have searched everywhere for the answer to this question, so my apologies if I missed it somewhere on this forum. I'm looking to create a subprocess when my Golang executable launches. This is no different than calling the fork() function in C. In fact, the following code represents exactly w

Re: [go-nuts] why this?

2016-09-29 Thread 'Axel Wagner' via golang-nuts
On Thu, Sep 29, 2016 at 7:09 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > I think you still can't "get" the chief distinction: it lies in typing > not in similarities of syntax. > > For > > m := make(map[string]interface{}) > > there's a well-defined zero value for the typ

[go-nuts] Re: Licenses

2016-09-29 Thread 'Eric Johnson' via golang-nuts
On Thursday, September 29, 2016 at 1:12:41 AM UTC-7, dja...@gmail.com wrote: > > Hi, > May be OT, but: > > Can i translate some GPLv2 licensed C code to GO, and publish it under > BSD new license ? > Code comments are from original C code. > The correct way to do this would be to perform a "cl

Re: [go-nuts] why this?

2016-09-29 Thread Konstantin Khomoutov
On Thu, 29 Sep 2016 09:38:24 -0700 (PDT) T L wrote: > > > I just expect type asserting on a non-nil interface value > > > shouldn't > > panic. > > > > of course it should panic if the interface holds an unexpected > > value and you're not checking for correctness with the comma-ok > > pattern.

[go-nuts] Re: TimeZone Query: Time Difference between EST and UTC

2016-09-29 Thread Adam Webb
Hi, EST is 5 hours difference from UTC. https://www.timeanddate.com/time/zones/est However, most of those locations are currently using EDT which is 4 hours due to daylight savings. This is a common confusion of timezones so it depends on which one you mean. I live in a place that CST all year

[go-nuts] go tcp assembly missing packets

2016-09-29 Thread Behram Khan
I am trying to use use the tcp assembly package to start reassembling TCP streams. I have looked at two examples https://github.com/google/gopacket/tree/master/examples/httpassembly and https://github.com/google/gopacket/tree/master/examples/statsassembly These example work fine if I am se

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 11:48:34 PM UTC+8, andrey mirtchovski wrote: > > > I just expect type asserting on a non-nil interface value shouldn't > panic. > > of course it should panic if the interface holds an unexpected value > and you're not checking for correctness with the comma-

Re: [go-nuts] TimeZone Query: Time Difference between EST and UTC

2016-09-29 Thread Andy Balholm
Right now there is a 4-hour difference between Eastern (Daylight) Time and UTC. But you asked for “EST”, and that is what you got: Eastern *Standard* Time. If you want a Location that automatically switches between EST and EDT, ask for “America/New_York”. Andy -- You received this message bec

Re: [go-nuts] why this?

2016-09-29 Thread andrey mirtchovski
> I just expect type asserting on a non-nil interface value shouldn't panic. of course it should panic if the interface holds an unexpected value and you're not checking for correctness with the comma-ok pattern. Go is a statically typed language and by asserting the wrong type on a variable you

[go-nuts] TimeZone Query: Time Difference between EST and UTC

2016-09-29 Thread laxman . vallandas
Hi, Google shows difference between EST and UTC as 4 hours whereas go logic gives 5 hours difference in time. https://play.golang.org/p/zHc9hM15iH Is there any issue in my logic?? Thanks LV -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 8:46:14 PM UTC+8, Konstantin Khomoutov wrote: > > On Thu, 29 Sep 2016 00:25:23 -0700 (PDT) > T L > wrote: > > > > > I just want to understand what is the deep reason for the syntax > > > > inconsistency between map index and type assert. > > > > > > a map

[go-nuts] lastdaychat (anonymous secure chat)

2016-09-29 Thread Nikita Loskutov
Hello! I think nowadays it's difficult to talk anonymous in the Web, so I tried to do one's bit. And I wrote my own simple anonymous secure chat. All messages encrypts and decrypts with AES-256 on clients based on secrets which you may tell just your friends, server knows nothing. *lastdaychat

Re: [go-nuts] Golang smtp package support for CC and BCC

2016-09-29 Thread asit dhal
I understood. Thanks On Mon, Sep 26, 2016 at 5:54 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Mon, 26 Sep 2016 14:49:57 + > "Manuel Amador (Rudd-O)" wrote: > > > > I don't see any functions in Golang net/smtp package for CC and > > > BCC. Does it support those func

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread 刘桂祥
if use go1.7 in runtime/malloc.go file add mallocgc debug info and go install and go run x.goI will get a error "signal: segmentation fault" in go1.4.2 will not func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { println("mallocgc:size=", size, "kind=", typ.kind, "nee

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread Dave Cheney
You should use Go 1.7.1 or later. On Thursday, 29 September 2016 23:00:25 UTC+10, 刘桂祥 wrote: > > package main > > import "runtime" > > func main() { > m := new(runtime.MemStats) > runtime.ReadMemStats(m) > cap := 1024 > println("debug0") > s := make([]byte, cap) > println(

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread 刘桂祥
package main import "runtime" func main() { m := new(runtime.MemStats) runtime.ReadMemStats(m) cap := 1024 println("debug0") s := make([]byte, cap) println("debug1") _ = s runtime.ReadMemStats(m) println("memstats:", m.Alloc, m.Mallocs) } I use go1.4.2 and In

Re: [go-nuts] why this?

2016-09-29 Thread Konstantin Khomoutov
On Wed, 28 Sep 2016 23:07:06 -0600 andrey mirtchovski wrote: > > I just want to understand what is the deep reason for the syntax > > inconsistency between map index and type assert. > > a map is fully typed at compile time. even if its key is of type > interface{} the language defines how to co

Re: [go-nuts] why this?

2016-09-29 Thread Konstantin Khomoutov
On Thu, 29 Sep 2016 00:25:23 -0700 (PDT) T L wrote: > > > I just want to understand what is the deep reason for the syntax > > > inconsistency between map index and type assert. > > > > a map is fully typed at compile time. even if its key is of type > > interface{} the language defines how to

[go-nuts] Re: glog log rotate not working correctly

2016-09-29 Thread Dave Cheney
Did you find the open deleted file in /proc/.../fds ? On Thursday, 29 September 2016 22:37:47 UTC+10, ramkumar.g...@gmail.com wrote: > > So it looks like a bug in the glog library. Anyway to file a bug against > it? -- You received this message because you are subscribed to the Google Groups

[go-nuts] glog log rotate not working correctly

2016-09-29 Thread ramkumar . gowrishankar
So it looks like a bug in the glog library. Anyway to file a bug against 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 golang-nuts+unsubscr...@googlegroups.

[go-nuts] Re: go-gcnl: Golang library for accessing the Google Cloud Natural Language API

2016-09-29 Thread Daniel Whitenack
Thanks Josh! This is a nice complement to the auto generated libraries which as stated: "Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice." I added your library here: https://github.com/gopherds/resources/

Re: [go-nuts] Re: gomobile: target=ios, getting incompatible pointer types assigning to 'GoUniverseerror *' from 'goSeqErrorWrapper *' [-Wincompatible-pointer-types]

2016-09-29 Thread Joe Blue
Yeah i saw thats the way the team were doing it in the example. I tried it, and sure it works. And it also adds the path. But there was also lots of mis information about how to use it. gopaths being hard coded in it etc etc etc. I saw your comment recently about how to correctly use it. But i dec

Re: [go-nuts] Licenses

2016-09-29 Thread andrey mirtchovski
> Also, Can I in my BSD licensed GO project, link to GPLv2 library ? You may link to the library via cgo if the author has given you permission to do so. Usually this is done via a separate COPYING.LIB file which contains the GNU LGPLv2 text in the library's repository (the COPYING file still cont

Re: [go-nuts] Re: gomobile: target=ios, getting incompatible pointer types assigning to 'GoUniverseerror *' from 'goSeqErrorWrapper *' [-Wincompatible-pointer-types]

2016-09-29 Thread Elias Naur
Is there a reason you're not using the gobind gradle plugin? If you need an example, the "bind" app from gomobile uses it to automatically generate the aar-file during builds. - elias On Thursday, September 29, 2016 at 9:50:17 AM UTC+2, Joe Blue wrote: > > upgrading caused a new problem on the

Re: [go-nuts] Re: Connect In Database

2016-09-29 Thread Josh Kamau
Let me try ;) You can use package database/sql to connect to any sql database that has a golang driver. Here is a list of some database drivers https://github.com/golang/go/wiki/SQLDrivers Here is some documentation: http://go-database-sql.org/ And here is a video https://www.youtube.com/watch?v

Re: [go-nuts] Re: Which web framework is recommended to use with GO?

2016-09-29 Thread Simon Ritchie
> I am looking at building a rest API system ... Looking to use MVC pattern. I have implemented a very simple database-driven website built using MVC. It has a single table and RESTful requests implementing the CRUD operations on the table. The design supports the use of interfaces and Inversi

Re: [go-nuts] Getting error back after executing a shell script via Golang

2016-09-29 Thread Konstantin Khomoutov
On Thu, 29 Sep 2016 01:47:36 -0700 (PDT) DM wrote: > Cross-posting this from stackoverflow > > :- > > I have a simple shell script (named copy.sh) which looks like below:- > > #! /bin/sh

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
Because they are different operations, they just happen to share a similar syntax. For example a, b := 1, 0 c := a - b d := a / b One of these generates no result, the other panics. Following your logic, should division have a two arg form that says if the dividend was zero, and if so would

Re: [go-nuts] why this?

2016-09-29 Thread 'Axel Wagner' via golang-nuts
I don't understand where we are talking past each other. I am aware, what the current behavior is. I am (and T L was asking) for technical reasons why a) any justification for the behavior of the type-assertion doesn't apply to map-access and b) any justification for the behavior of the map-access

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
That's what happens now with the two arg version, the one arg version panics rather than letting you think you got a valid value of the type you expected. On Thu, 29 Sep 2016, 19:44 Axel Wagner wrote: > The thing you are asserting to, obviously? The types are not a problem if > you do > v, ok :=

Re: [go-nuts] why this?

2016-09-29 Thread 'Axel Wagner' via golang-nuts
The thing you are asserting to, obviously? The types are not a problem if you do v, ok := iface.(someType) v simply has type someType and will be the zero-value if iface doesn't contain a someType. Why should this be a problem for the non-comma-ok version? I.e., what would be the technical difficul

Re: [go-nuts] image: algorithm to convert to grayscale

2016-09-29 Thread Rodolfo Carvalho
Thanks everyone for the answers and links. I computed a pixel-to-pixel difference and indeed what I was getting was -1/+1 differences in the gray values, due to rounding. Next free time I'll try the other formulas. Thank you again, Rodolfo Carvalho On Thu, Sep 29, 2016 at 6:12 AM, Micky wrot

Re: [go-nuts] Re: go escape analysis

2016-09-29 Thread Dave Cheney
-gcflags=-m is your guide. There are no documents of the escape analysis done by the gc compiler, but you could read the source of cmd/compile/internal/gc/esc.go -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
A type assertion is dangerous because if the thing you are asserting to doesn't match the type of the value inside the interface, what type should the result be? With the map example the type of the result is known. On Thu, 29 Sep 2016, 19:36 Axel Wagner wrote: > On Thu, Sep 29, 2016 at 9:31 AM,

Re: [go-nuts] why this?

2016-09-29 Thread 'Axel Wagner' via golang-nuts
On Thu, Sep 29, 2016 at 9:31 AM, Dave Cheney wrote: > Sorry, I misspoke, this logic does not apply to map lookup But why? It seems to me, everything you said can just as easily be applied to map lookups. Why is a zero-value on a type-assertion potentially dangerous, while it's fine on a map-loo

Re: [go-nuts] Re: go escape analysis

2016-09-29 Thread 刘桂祥
veyr thanks and want to know more about go's compile and escape rules 在 2016年9月29日星期四 UTC+8上午1:39:09,Chris Manghane写道: > > In the first example, make does not escape the scope of the for statement. > In the second example, make is assigned to m, which is outside of the scope > of the for statem

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread Dave Cheney
Sorry, you'll have to work harder to generate a memory profile. My github.com/pkg/profile package may help automate some of the work, but may introduce a few allocations of its own which you will have to filter out. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread 刘桂祥
package main import "runtime" func init() { runtime.MemProfileRate = 1 } func main() { m := new(runtime.MemStats) runtime.ReadMemStats(m) println(m.Alloc, m.Mallocs) cap := 1024 * 1024 * 4 s := make([]byte, cap) _ = s runtime.ReadMemStats(m) println(m.Alloc, m.

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread 刘桂祥
package main import "runtime" func init() { runtime.MemProfileRate = 1 } func main() { m := new(runtime.MemStats) runtime.ReadMemStats(m) println(m.Alloc, m.Mallocs) cap := 1024 * 1024 * 4 s := make([]byte, cap) _ = s runtime.ReadMemStats(m) println(m.Alloc, m.

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread Dave Cheney
One way to do this might be to enable memory profiling in your program with the rate set to 1. Hopefully this will record the stack trace of every allocation. The data may need some interpretation -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
It's all in the release history, this change occured before Go 1.0. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For

[go-nuts] Getting error back after executing a shell script via Golang

2016-09-29 Thread DM
Cross-posting this from stackoverflow :- I have a simple shell script (named copy.sh) which looks like below:- #! /bin/sh cp $1 $2 I did chmod 777 copy.sh. I have a golang code which exe

[go-nuts] Re: Licenses

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 4:24:51 PM UTC+8, T L wrote: > > > > On Thursday, September 29, 2016 at 4:12:41 PM UTC+8, dja...@gmail.com > wrote: >> >> Hi, >> May be OT, but: >> >> Can i translate some GPLv2 licensed C code to GO, and publish it under >> BSD new license ? >> Code comments

[go-nuts] Re: go analysis memory mallocs

2016-09-29 Thread 刘桂祥
In my two examples, I use variable in makeslice that it will all escape to the heap , But I just want to use runtime.ReadMemStats to lookup it and find strange

[go-nuts] Re: Licenses

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 4:12:41 PM UTC+8, dja...@gmail.com wrote: > > Hi, > May be OT, but: > > Can i translate some GPLv2 licensed C code to GO, and publish it under > BSD new license ? > Code comments are from original C code. > no, http://programmers.stackexchange.com/questions/

[go-nuts] Licenses

2016-09-29 Thread djadala
Hi, May be OT, but: Can i translate some GPLv2 licensed C code to GO, and publish it under BSD new license ? Code comments are from original C code. Also, Can I in my BSD licensed GO project, link to GPLv2 library ? Regards, Djadala -- You received this message because you are subscribed to

[go-nuts] Re: go compile for memory allocation

2016-09-29 Thread 刘桂祥
https://github.com/golang/go/issues/17275 在 2016年9月29日星期四 UTC+8下午2:57:08,Dave Cheney写道: > > Don't forget to log that issue. -- 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 a

[go-nuts] Re: Connect In Database

2016-09-29 Thread hadiesmaili85
On Thursday, September 29, 2016 at 1:04:34 AM UTC-7, hadies...@gmail.com wrote: > > Hi > > we can with this *package database/sql* connect to any databases??? > > > if you'r Answer is NO then help me. > > > THANKS > -- You received this message because you are subscribed to the Google Group

[go-nuts] Re: Connect In Database

2016-09-29 Thread hadiesmaili85
On Thursday, September 29, 2016 at 1:04:34 AM UTC-7, hadies...@gmail.com wrote: > > Hi > > we can with this *package database/sql* connect to any databases??? > > > if you'r Answer is NO then help me. > > > THANKS > -- You received this message because you are subscribed to the Google Groups

[go-nuts] Connect In Database

2016-09-29 Thread hadiesmaili85
Hi guys we can with this *package database/sql* connect to any databases??? if you'r Answer is NO then help me. THANKS -- 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

Re: [go-nuts] Re: gomobile: target=ios, getting incompatible pointer types assigning to 'GoUniverseerror *' from 'goSeqErrorWrapper *' [-Wincompatible-pointer-types]

2016-09-29 Thread Joe Blue
upgrading caused a new problem on the android side. ``` Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Error:Execution failed for task ':app:prepareMd01CliUnspecifiedLibrary'. > Could not e

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 3:37:59 PM UTC+8, Dave Cheney wrote: > > If you think that's inconsistent, you should see how we used to delete > things from maps ;) used to? Any change made for deleting things from maps in history? -- You received this message because you are subscribed

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
If you think that's inconsistent, you should see how we used to delete things from maps ;) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr..

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 3:31:46 PM UTC+8, Dave Cheney wrote: > > Sorry, I misspoke, this logic does not apply to map lookup, they are > unrelated other than having a one arg and two arg form. :) yes, that is what the weirdness and inconsistency is. -- You received this message b

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
Sorry, I misspoke, this logic does not apply to map lookup, they are unrelated other than having a one arg and two arg form. -- 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

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 3:21:26 PM UTC+8, Volker Dobler wrote: > > Am Donnerstag, 29. September 2016 07:02:26 UTC+2 schrieb T L: >> >> I know of the syntax in spec. >> I just want to understand what is the deep reason for the syntax >> inconsistency between map index and type assert.

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
That sounds like a very bad idea. You type assert to the wrong type and receive a valid blank value for that type. If you're lucky the program crahesh immedialy because the type's zero value is nil, if you're not the person program continues to execute using this types zero value for an unknown

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 1:07:17 PM UTC+8, andrey mirtchovski wrote: > > > I just want to understand what is the deep reason for the syntax > > inconsistency between map index and type assert. > > a map is fully typed at compile time. even if its key is of type > interface{} the lan

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 3:10:46 PM UTC+8, Dave Cheney wrote: > > Which of these would you prefer happened instead? > > * A failed type assertion always panic'd > * A failed type assertion never panic'd and instead returned the zero > value, as the map lookup does > * Something else >

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 1:33:40 PM UTC+8, Micky wrote: > > TL, the simplest reason is this: > > You can live without the "ok idiom" when retrieving a map value but you > cannot when type asserting. Think of the consequences for rest of your > program, if you forgot to check the stat

Re: [go-nuts] why this?

2016-09-29 Thread Volker Dobler
Am Donnerstag, 29. September 2016 07:02:26 UTC+2 schrieb T L: > > I know of the syntax in spec. > I just want to understand what is the deep reason for the syntax > inconsistency between map index and type assert. > "deep reason"s are found in religion and math not in programming language design

Re: [go-nuts] Re: gomobile: target=ios, getting incompatible pointer types assigning to 'GoUniverseerror *' from 'goSeqErrorWrapper *' [-Wincompatible-pointer-types]

2016-09-29 Thread Joe Blue
i upgraded: gomobile version +9640137 Tue Sep 27 16:37:51 2016 + (android,ios); androidSDK=/Users/apple/Library/Android/sdk/platforms/android-24 It fixed all the errors:) thankyou On Thu, Sep 29, 2016 at 9:13 AM Joe Blue wrote: > thank Elias. Nice > > I am on this version: > > x-MacBook

Re: [go-nuts] Re: gomobile: target=ios, getting incompatible pointer types assigning to 'GoUniverseerror *' from 'goSeqErrorWrapper *' [-Wincompatible-pointer-types]

2016-09-29 Thread Joe Blue
thank Elias. Nice I am on this version: x-MacBook-Pro:rpc apple$ gomobile version gomobile version +7573efa Wed Aug 24 22:21:38 2016 + (android,ios); androidSDK=/Users/apple/Library/Android/sdk/platforms/android-24 I will upgrade now and see if i get the same errors. thanks On Wed, Sep 2

Re: [go-nuts] why this?

2016-09-29 Thread Dave Cheney
Which of these would you prefer happened instead? * A failed type assertion always panic'd * A failed type assertion never panic'd and instead returned the zero value, as the map lookup does * Something else Dave -- You received this message because you are subscribed to the Google Groups "go

[go-nuts] glog log rotate not working correctly

2016-09-29 Thread Dave Cheney
This is usually caused by the process writing to a log file that has been deleted. This is a very common bug with programs that rotate their own logs and a major reason why 12 factor apps recommend that log rotation be down by an external program. Have a look in /proc/yourprocess/fd with ls -a

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 1:31:41 PM UTC+8, Ian Lance Taylor wrote: > > On Wed, Sep 28, 2016 at 10:02 PM, T L > > wrote: > > > > On Thursday, September 29, 2016 at 12:56:57 PM UTC+8, Micky wrote: > >> > >> The reason is directly stated in the Go language spec: > >> > >> "If the ty

Re: [go-nuts] why this?

2016-09-29 Thread T L
On Thursday, September 29, 2016 at 1:07:42 PM UTC+8, Henrik Johansson wrote: > > I am not sure but perhaps as simple as it is a very natural and known > behavior of maps and to make it work syntactically as the type assertion > would make it weird. > > yes. It is really weird that the behavio