new issue address is https://github.com/golang/go/issues/17165
在 2016年9月20日星期二 UTC+8下午12:04:09,Ian Lance Taylor写道:
>
> On Mon, Sep 19, 2016 at 6:34 PM, Wanghb Wang > wrote:
> >
> >
> > 在 2016年9月20日星期二 UTC+8上午3:41:09,Ian Lance Taylor写道:
> >>
> >> On Mon, Sep 19, 2016 at 8:34 AM, Wanghb Wang
>
> my dll is compile by visual studio 2015 on windows10
>
If you think this is safe , you can rename the attachment test001DLL as
test0001.dll, or you can find code from
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from t
On Mon, Sep 19, 2016 at 6:34 PM, Wanghb Wang wrote:
>
>
> 在 2016年9月20日星期二 UTC+8上午3:41:09,Ian Lance Taylor写道:
>>
>> On Mon, Sep 19, 2016 at 8:34 AM, Wanghb Wang wrote:
>> >
>> > when I use stattcpupprof in my program, I got fatal error malloc
>> > deadlock.
>> > delete the cpu pprof, the program
On Tuesday, September 20, 2016 at 11:00:34 AM UTC+8, Peng Gao wrote:
>
> BTW in your test file, you can directly append your bytes slice.
> b1 = append(b1, vs...)
> and slicesEqual is redundant, bytes.Equal does test the length of two
> arguments
>
I mix up cap and len, just ignore it.
>
> On
BTW in your test file, you can directly append your bytes slice.
b1 = append(b1, vs...)
and slicesEqual is redundant, bytes.Equal does test the length of two
arguments.
On Tuesday, September 20, 2016 at 6:56:55 AM UTC+8, Caleb Spare wrote:
>
> I'm trying to call a Go function from asm and I'm ha
在 2016年9月20日星期二 UTC+8上午3:41:09,Ian Lance Taylor写道:
>
> On Mon, Sep 19, 2016 at 8:34 AM, Wanghb Wang > wrote:
> >
> > when I use stattcpupprof in my program, I got fatal error malloc
> deadlock.
> > delete the cpu pprof, the program run well.
> >
> >
> > my question is :
> > Does startcp
On 20 Sep 2016 9:03 a.m., "Robert Solomon" wrote:
>
> FileReadBuffer := make([]byte,ReadBufferSize);
> for { // Repeat Until eof loop.
> n,err := TargetFile.Read(FileReadBuffer);
> if n == 0 || err == io.EOF { break }
> check(err," Unexpected error while reading the tar
In theory the compiler can be smart enough, if it knows that the string
passed to fmt.Println is not stored and re-used someplace, but I do not
believe that is currently true. It probably has at least 2 copies, one to
the string in your code and a second one to make it a []byte to pass to the
io.
On Mon, Sep 19, 2016 at 3:56 PM, Caleb Spare wrote:
> I'm trying to call a Go function from asm and I'm having trouble figuring
> out the details.
>
> (In the past I've always endeavored to avoid this situation and make all my
> asm functions be leaf functions, but in my current use case it would
well, seems to me if you need to access a string by index, you are assuming
1 byte per char. say ASCII, so for me you should be using []byte to store
it, then 'cast' to see it as a string.
https://play.golang.org/p/2NMye8gnzg
surely this doesn't do any copying?
--
You received this message be
Yes, so what you are describing to me needs to be told to the C compiler
users in a formal way so that they make sure their alignment is the same as
Go. Thanks.
On Mon, Sep 19, 2016 at 2:27 PM, Ian Lance Taylor wrote:
> On Mon, Sep 19, 2016 at 2:08 PM, Ali Demir wrote:
> > Packing option is exp
Hi. I'm trying to learn Go after many years of using a different
language. My development machine runs Ubuntu 16.04 amd64, go 1.6.2
linux/amd
I compared the output of the following code, and my output differs from the
std utilities such as sha1sum, sha215sum, etc. I used
go1.6.3.windows-386.msi
I'm trying to call a Go function from asm and I'm having trouble figuring
out the details.
(In the past I've always endeavored to avoid this situation and make all my
asm functions be leaf functions, but in my current use case it would be
most helpful to be able to call a Go helper.)
See the demo
On Mon, Sep 19, 2016 at 3:49 PM, Alex Flint wrote:
>
> Just to confirm: it's not possible that the dynamic type of x as seen from
> Go code would be ExplicitFunc, but the interface stores a *ExplicitFunc
> internally within the itab, and so the compiler generates
> (*ExplicitFunc).Call?
That is c
Thanks Ian.
Just to confirm: it's not possible that the dynamic type of x as seen from
Go code would be ExplicitFunc, but the interface stores a *ExplicitFunc
internally within the itab, and so the compiler generates
(*ExplicitFunc).Call?
On Mon, Sep 19, 2016 at 3:46 PM Ian Lance Taylor wrote:
A string is immutable, a byte slice is not.
Suppose you have:
b := []byte("hello world")
s := string(b)
fmt.Println(s)
b[0] = 'H'
fmt.Println(s)
What is printed?
hello world
hello word
Using the OPs function:
b := []byte("hello world")
s := fastBytesToString(b)
fmt.Println(s)
b[0] = 'H'
fmt.
On Mon, Sep 19, 2016 at 2:35 PM, wrote:
> I don't like the extra allocation and copies involved when casting from byte
> slice to string or vice versa just because one type or the other is
> required. The code below reuses the data pointer and as far as I can tell in
> my tests so far, it even wo
On Mon, Sep 19, 2016 at 3:21 PM, Alex Flint wrote:
> I am looking for help understanding the following lines in a Go traceback:
>
> 6 File "specialized.go" line 163 in pythontype.ExplicitFunc.Call
> 7 File "" line 510 in pythontype.(*ExplicitFunc).Call
> 8 File "propagate.go" line 622 in
> pythons
i thought strings were just byte[]s, when you 'cast' all you do is tell the
compiler to change the way the underlying bytes can are used. it doesn't
'cost' anything.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group
I am looking for help understanding the following lines in a Go traceback:
6 File "specialized.go" line 163 in pythontype.ExplicitFunc.Call
7 File "" line 510 in pythontype.(*ExplicitFunc).Call
8 File "propagate.go" line 622 in
pythonstatic.(*propagator).evaluateCallExpr
I am trying to understand
Try b.ReportAllocs() before your benchmark loop. That's the easiest way to
benchmark the allocations per operation.
--
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
As long as no one modifies the bytes in the byteslice. Go can no longer
enforce that the string is immutable with this hack.
On Mon, Sep 19, 2016 at 2:35 PM, wrote:
> I don't like the extra allocation and copies involved when casting from
> byte slice to string or vice versa just because one ty
I don't like the extra allocation and copies involved when casting from
byte slice to string or vice versa just because one type or the other is
required. The code below reuses the data pointer and as far as I can tell
in my tests so far, it even works well with garbage collection. My question
On Mon, Sep 19, 2016 at 2:08 PM, Ali Demir wrote:
> Packing option is explicitly specified for VC++:
>
> https://msdn.microsoft.com/en-us/library/xh3e3fd0.aspx
>
> The user needs to make sure whatever they pick (or default) in their project
> matches what Go compiler used. So it may help to specif
Try this tutorial:
http://go-database-sql.org/
On 20 September 2016 at 03:42, kumargv wrote:
> import MySQLdb
>
> conn = MySQLdb.Connect(
> host='localhost', user='user',
> passwd='secret', db='test')
> cursor = conn.cursor()
> cursor.execute("SELECT this,that FROM foobar")
> rows = curs
The pkg plugin is intended to allow writing "plugin-aware" Go apps, and
plugins for them - cooperatively (that is, a "host" app must use this
package and provide explicit "hook" points for plugins). The idea is
outlined (since quite long ago) at the link mentioned by Ian L.T. earlier:
https://g
I've got a function that reads `map[string]interface{}` off a channel,
processing each one until that channel is closed. Processing each `map`
entails allocating some slices and other data structures, grouping by like
keys, etc.
I've got a benchmark that reads 1 rows of JSON from a file, un
Packing option is explicitly specified for VC++:
https://msdn.microsoft.com/en-us/library/xh3e3fd0.aspx
The user needs to make sure whatever they pick (or default) in their
project matches what Go compiler used. So it may help to specify what go
compiler is using.
On Mon, Sep 19, 2016 at 10:00
On Mon, Sep 19, 2016 at 8:34 AM, Wanghb Wang wrote:
>
> when I use stattcpupprof in my program, I got fatal error malloc deadlock.
> delete the cpu pprof, the program run well.
>
>
> my question is :
> Does startcpuprof infect the malloc or resulting OOM Problem
I'm sorry, I don't understand the
I think you'll need something like x := float(355) / float(113) - where
float is either float32 or float64 depending on your preferred trade-off
for accuracy vs bytes required per number.
On Monday, September 19, 2016 at 12:38:12 PM UTC-4, Mark Longtin wrote:
>
> Hey guys,
>
> I'm new to Go -
Some projects (such as kubernetes and docker) do not use the standard
'flag' package and instead use the posix complaint(ish)
https://github.com/spf13/pflag
package. It however appears that
https://github.com/golang/glog/pull/13
Added a check for `flag.Parsed()`. This is not correct for program
Am Montag, 19. September 2016 13:51:17 UTC+2 schrieb Jan Mercl:
>
> On Sun, Sep 18, 2016 at 10:46 AM Johann Höchtl > wrote:
>
> > I thought Vim 8 packages are all automatic. vim-go commands like :help
> vim-go or :GoUpdateBinaries do not work.
>
> Are you using the vim-8.0 branch? (
> https://g
On Mon, Sep 19, 2016 at 8:50 AM, Ali Demir wrote:
> Header file won't have padding / alignment info. That would be a compiler
> setting on the C side that is using the header. So the programmer needs to
> setup C compiler in a way that is compatible with the go compiler. How would
> he know how to
float64(355)/113
--
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 more options, visit https://groups.google.com/d/opt
Hey guys,
I'm new to Go - through the Ivy app on IOS- so I have a newbie question.
What's the easiest way to cast or convert a rational number to its floating
point representation?
EG, looking for something like this:
*float 355/113*3.14159292035
I could do something inelegant like
*floor
What version of Go are you using (go version)?
go version go1.7 windows/amd64
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Go_workspace
set GORACE=
set G
I tried to `escape` dollar sign when using os.Getenv;
I found that golang doesn’t do exactly what I expect (for example
`$$var_one` —> print `$var_one`).
Any suggestion?
https://play.golang.org/p/8fXS4QfCIi ,
my temporary solution requires copying code from golang os pkg
https://play.golang.or
I fixed that but I still get errors connecting to the SQL database. Should
I deactivate XAMPP before trying it out?
On Monday, September 19, 2016 at 12:35:30 PM UTC+3, Harald Weidner wrote:
>
> Hello,
>
> On Mon, Sep 19, 2016 at 01:37:14AM -0700, loc...@gmail.com
> wrote:
>
> > import(
> >
Thanks Nick,
This looks promising!
--
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 more options, visit https://group
Header file won't have padding / alignment info. That would be a compiler
setting on the C side that is using the header. So the programmer needs to
setup C compiler in a way that is compatible with the go compiler. How
would he know how to set it up? Do we just assume defaults are the same
between
cursor = conn.cursor(MySQLdb.cursors.DictCursor)
cursor.execute('SHOW SLAVE STATUS')
result = cursor.fetchone()
cursor.close()
I am unable to Impement this in golang
Please suggest
--
You received this message because you are subscribed to the Google Groups
"golang-nuts
import MySQLdb
import MySQLdb.cursors
conn = MySQLdb.Connect(
host='localhost', user='user',
passwd='secret', db='test')
cursor = conn.cursor(cursorclass=MySQLdb.cursors.DictCursor)
cursor.execute("SELECT this,that FROM foobar")
rows = cursor.fetchall()
for row in rows:
print row['this
import MySQLdb
conn = MySQLdb.Connect(
host='localhost', user='user',
passwd='secret', db='test')
cursor = conn.cursor()
cursor.execute("SELECT this,that FROM foobar")
rows = cursor.fetchall()
cursor.close()
conn.close()
I am unable to Implement The above code in golang
Please suggest
when I use stattcpupprof in my program, I got fatal error malloc deadlock.
delete the cpu pprof, the program run well.
my question is :
Does startcpuprof infect the malloc or resulting OOM Problem
this is my panic stack trace:
fatal error: malloc deadlock
goroutine 17 [running, locked to threa
Adding an scp package is a nice addition.
You might want to consider simple names like:
Send - Sends from []byte to file on remote host
SendDir - Send files in dir to a remote host
SendFile - Sends the contents of a file to the remote host
Fetch - Fetches the contents of a file on remote host int
On Sun, Sep 18, 2016 at 11:10 PM, wrote:
> Is there any update to alignment/padding for structs now that we can write
> .so files that can be called by C programs? We would have to know it to tell
> the C compiler what to expect from go side imho.
When you use //export with cmd/cgo you will get
On Mon, Sep 19, 2016 at 3:58 PM wrote:
> Anybody with same experiences?
https://github.com/robpike/ivy/issues/29
--
-j
--
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
A busy loop is always a programming error, and there's no reason to do this
is your code. If you actually did have a loop with no function calls that's
somehow useful, you could add occasional calls to runtime.Gosched() to
yield to the scheduler.
--
You received this message because you are
* Fei Ding [160918 02:58]:
> Thanks, Marvin, I've learned a lot from your reply. And, I've written more
> code, like:
>
> a, b, c := 1, 2, 3
> > slice1 := []int{a, b, c}
> > for _, n := range slice1 {
> > go func(n *int) {fmt.Println(*n)}(&n)
> > }
>
>
> It seems that pass *n's address *in the
What version of Go are you using (go version)?
go 1.6.2 mac/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/data/apps/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr
Is there any update to alignment/padding for structs now that we can write
.so files that can be called by C programs? We would have to know it to
tell the C compiler what to expect from go side imho.
On Thursday, April 5, 2012 at 9:10:48 PM UTC-7, Kyle Lemons wrote:
>
> On Thu, Apr 5, 2012 at
- Downloaded Ivy 1.0 from the Apple AppStore
- Tried to open it but immediately crashes
Anybody with same experiences?
--
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 emai
On Sun, Sep 18, 2016 at 10:46 AM Johann Höchtl
wrote:
> I thought Vim 8 packages are all automatic. vim-go commands like :help
vim-go or :GoUpdateBinaries do not work.
Are you using the vim-8.0 branch? (
https://github.com/fatih/vim-go/tree/vim-8.0)
--
-j
--
You received this message becaus
On 19/09/16 10:49, DrGo wrote:
> Has any used Go to develop a cross-platform an easy-to-use utility to encrypt
> individual files or folders?
>
You could use rclone to encrypt a directory of files. It can also
transfer them to cloud storage systems too!
See rclone.org for docs and github.com/
On Monday, September 19, 2016 at 5:13:21 AM UTC-4, Tamás Gulácsi wrote:
>
> Nope, I'm on neovim (with plug for the plugins) for a long time now...
I don't think I even needed a plug for the plugins -- I just cp -r ~/.vim
~/.config/nvim and everything worked, including vim-go.
--- SER
--
You r
Has any used Go to develop a cross-platform an easy-to-use utility to encrypt
individual files or folders?
--
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 golan
I'm sorry this did not fix your problem. Can you please try to explain your
problem, I don't think I understand what the issue you are having is.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
Hello,
On Mon, Sep 19, 2016 at 01:37:14AM -0700, loc...@gmail.com wrote:
> import(
> _ "github.com/go-sql-driver"
> )
The correct name of this package is: github.com/go-sql-driver/mysql
Harald
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
it changes nothing :(
--
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 more options, visit https://groups.google.co
Your Sprintf call has two arguments but you have provided only one directives.
Try deleting the version argument you pass to Sprintf
--
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
Nope, I'm on neovim (with plug for the plugins) for a long time now...
--
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.
F
here is my code :
package main
import (
"fmt"
"math/big"
"log"
"os"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/base58"
)
func main() {
// Print header
// Ini
Guys, nobody using Vim 8 and the venerable go-vim plugin in Vim 8 as a
package? Don't let me down on that!
--
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
What did you expect to see when you ran that code?
What did you see instead?
--
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
Hello, everyone. I downloaded the SQL-connect driver for GOlang from GitHub
and cannot seem to connect to my MYSQL database which was installed along
with XAMPP. Below is the code:
package main
import(
"fmt"
"database/sql"
_ "github.com/go-sql-driver"
)
func main(){
mysql, err := sql.Open(
What did you expect to happen when you ran this program?
What happened instead?
--
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...@googlegro
Hello I have a desire to write in the result of the code file:
package main
import (
"fmt"
"math/big"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/base58"
)
func main() {
// Print h
67 matches
Mail list logo