Go语言中文网 为您找到相关结果 2791

Installing godef

<p>Hi! I am getting started with go and I have trouble getting godef. The instructions says &#39;go get code.google.com/p/rog-go/exp/cmd/godef&#39;, which fails with 9fans.net not being accessible. I found a 9fans.net github mirror on github, but &#39;go get -v github.com/9fans/go&#39; says no buildable Go source files and fai...阅读全文

资源 2015-04-04 08:16:32 blov

TLS Handshake Error

<p>I&#39;m attempting to explicitly execute a TLS Handshake (i.e. StartTLS) and when doing so receive a version mismatch error.</p> <p>what would cause tls.Handshake() to error with <code> received record with version 502 when expecting version 303 </code></p> <p>I&#39;m not sure where to find or ...阅读全文

资源 2016-05-06 21:35:31 agolangf

Ogg CRC32 in Golang

<p>The <a href="https://xiph.org/vorbis/doc/framing.html" rel="nofollow">Ogg audio framing format</a> has a 32-bit field in page headers that is supposed to store a 32-bit CRC checksum of the entire page. That is, the checksum field is set to 0, then the page is fed into CRC, and then the checksum field set to the ...阅读全文

资源 2015-04-17 16:10:02 blov

LDAP CRUD

<p>can someone advice how to implement common CRUD for LDAP. The problem is in the fact that I need common solution for a. OpenLdap b. Active Directory c. 389 Directory There also exists posixAccount, shadowAccount.</p> <p>I am confused and need advice how best to implement it.</p> <hr/>**评论:**<br/><br...阅读全文

资源 2015-04-12 09:29:33 polaris

golang chan 超时

golang chan 超时 Posted on 2013-12-24 13:03 oathleo 阅读(4227) 评论(0) 编辑 收藏 package mainimport ( "fmt" "time")var ch chan int = make(chan int, 1)func main() { go aaa() select { case <-ch: //拿到锁 fmt.Println("call") case <-time.After(5 * time.Second): //超时5s fmt.Println("5 sec call") }}func aaa() { time.Sleep(time.Second * 3) ch <- 1...阅读全文

博文 2016-09-06 11:00:05 zhangym

HTTP KeepAlive in Go

<p>Does anybody know how to change the default TCP keepalive timeout in net/http?</p> <p>I&#39;m building a backend for a mobile app, and while intercepting packets with Wireshark I&#39;ve realized that the connection times out after 10 seconds of inactivity, no matter what. Sending a keepalive:timeout=30 header from the ...阅读全文

资源 2015-05-10 04:21:20 blov

Help with JSON Unmarshal

<p>I keep getting &#34;unexpected end of JSON input&#34; error when trying to unmarshal a response. </p> <p>Basically I hit a REST API endpoint, the output result is in &#34;JSON&#34; form but it shows as a string which I then unmarshal. The code I&#39;m using to unmarshal is below. Any suggestions?</p> ...阅读全文

资源 2016-01-04 16:18:30 xuanbao

Seeding rand.Intn

<p>Hey guys, I am messing around on A Tour of Go and The Go Playground trying to get a random number and it doesn&#39;t seem to be working. Should the following code work?</p> <p>package main </p> <p>import (<br/> &#34;fmt&#34;<br/> &#34;math/rand&#34;<br/> &#3...阅读全文

资源 2016-09-15 08:00:02 polaris

React server side rendering

<p>Hi all React provide server side page rendering with node like. Facebook provide for that a lot of functions like React.renderToStaticMarkup for rendering pages on the server side.<br/> It is possible to do server site rendering on golang too?<br/> I really enjoy programming in golang and the most of my work, I wrote a webservi...阅读全文

资源 2015-05-01 06:46:10 polaris

GoKit

<p>Hi all,<br/> Does anyone use GoKit in the Production?</p> <p>Thanks</p> <hr/>**评论:**<br/><br/>peterbourgon: <pre><p>Yes, there are organizations using it in production in various capacities. No, unfortunately I cannot give more information. Read the documentation and the code and deter...阅读全文

资源 2015-11-04 13:31:26 xuanbao

Termux and Golang (android)

<p>Hi Gophers, I recently installed Termux on an android phone (and a whole ecosystem Droid Edit, Amaze, etc...) to try to have my Go development on mobile. I did <strong>apt install golang</strong> with no issues, installed git too, setup my $GOPATH in shared space and all. I could even go get some packages like Bolt and Echo cor...阅读全文

资源 2017-02-06 12:00:21 blov

Logging in Go

<p>My question is two-fold: what are some best practices for logging errors/messages in Go, and to where do you typically log these messages?</p> <p>I&#39;m running a Go application on CentOS 7 using Systemd, and I noticed that all &#34;fmt.Println()&#39;s&#34; are being logged to Journald. Is this a good place to...阅读全文

资源 2015-05-27 08:58:48 blov

How I play with bolt database

<p>I have been playing with bolt database, and I wrote a helper for interacting with the bolt dabase. This was after I find it very difficult working with nested buckets.</p> <p>You can view the project here <a href="https://github.com/gernest/nutz" rel="nofollow">https://github.com/gernest/nutz</a> Pl...阅读全文

资源 2015-04-12 09:20:59 blov

What is the benefit of decoding strings with utf8 or converting the string to a []rune?

<p>I&#39;ve been working on porting a really small (and worthless) scripting language from Ruby to Go, mostly for learning but also for other projects I plan to build in the future. In doing this, I&#39;ve been building the lexer based on <a href="https://www.youtube.com/watch?v=HxaD_trXwRE">this video by Rob Pike</a&...阅读全文

资源 2015-05-06 02:48:22 blov

Go using mssqldb?

<p>any example of how to connect and run a query?</p> <hr/>**评论:**<br/><br/>ackondro: <pre><p>I&#39;d use <a href="https://github.com/denisenkom/go-mssqldb" rel="nofollow">https://github.com/denisenkom/go-mssqldb</a> with something like the folowing:</p> <pre><...阅读全文

资源 2016-04-08 22:36:16 xuanbao

Handling office documents in Go

<p>are there any go libraries that allow the creating and or manipulation of office documents(doc,docx,xl,odt) posible through templating?</p> <hr/>**评论:**<br/><br/>thyris: <pre><p>not that I&#39;m aware of but modern office docs (docx, xlsx, *x) are just zip files with xml. You can extract and then jus...阅读全文

资源 2016-03-19 11:55:32 agolangf

Probably a rookie question, but can't find anything about this: go get golang.org/x/crypto/bcrypt throws 'Segmentation fault' using go1.4.2-linux-amd64

<p>...and it&#39;s driving me insane. What am I doing wrong?</p> <p>To whom it may concern: it&#39;s a custom go1.4.2-linux-amd64 install on Lubuntu 15.04, go get github.com/anything/anything works like a charm. But I can&#39;t get to work golang.org/x/anything/anything. Both Git and Mercurial were installed with apt-...阅读全文

资源 2015-06-10 20:05:28 blov