Goの実行ファイルサイズを小さくするテクニック Go 1.11 Release Party@Tokyo 渋川よしき@フューチャー(株)
This post is also available in other languages: Russian: Введение в модули Go Uzbek: Go modullariga kirish The upcoming version 1.11 of the Go programming language will bring experimental support for modules, a new dependency management system for Go. A few days ago, I wrote a quick post about it. Since that post went live, things changed a bit and as we’re now very close to the new release, I tho
Go has a unique approach to error handling, with a combination of explicit error values and an exception-like panic mechanism. In this post I'm looking at the philosophical aspects of panic, trying to understand some of the conflicting guidelines coming from the Go team. Most of all, it's a story of pragmatism in language design, with some musings on the merits and dangers of a pragmatic approach.
One of the most exciting things about learning a foreign language is developing a proficiency for reading it. At first, sentences in the foreign languages start off as intimidating blocks of text, totally opaque and meaningless. With lots of practice, single words start to make sense here and there. A basic understanding of the language’s syntax transforms the process. Let’s use the Google Cloud N
2016 07 11 When it’s released later this month, Go 1.7 will move the x/net/context package to the stdlib, as plain old context. It also attaches a context object to net/http.Requests, and gives you a few helper methods. Dedicated Gophers are probably already familiar with the great introductory blog article by Sameer Ajmani, Go Concurrency Patterns: Context, published all the way back in 2014. If
tl;dr: functions that take an http.Handler and return a new one can do things before and/or after the handler is called, and even decide whether to call the original handler at all. If you’re building web services using Go (if you’re not, why not?) and you’re not using any middleware packages (and even if you are), then you need to understand the power of wrapping http.Handler types. An http.Handl
Make sense of your chaotic cloud-native environments with Instana’s fully automated application observability, delivering the context needed to take intelligent actions and ensure optimum application performance Making Observability Enterprise-Ready to help optimize Cloud-Native and legacy application performance Automates monitoring, tracing and profiling for all applications and services Provide
A few days ago in a move foreshadowed by a hint at Amazons’ re:Invent conference late last year, AWS released support for Go on its Lambda platform. Go users can now build programs with typed structs representing Lambda event sources and common responses in the aws-lambda-go SDK. These can then be compiled, bundled up into a “Lambda deployment package” (as simple as a ZIP file with a binary in it)
Taking inspiration from the Rails layouts and rendering guide, I thought it'd be a nice idea to build a snippet collection illustrating some common HTTP responses for Go web applications. Sending Headers Only Rendering Plain Text Rendering JSON Rendering XML Serving a File Rendering a HTML Template Rendering a HTML Template to a String Using Layouts and Nested Templates Sending Headers Only File:
今回は少し目先を変えて「Unicode 正規化(normalization)」のお話。 2羽の「ペンギン」 まず「ペンギン」という文字列を思い浮かべてみる。 この文字列を Unicode のコードポイントで表すと以下のようになる。 ペ:U+30DA ン:U+30F3 ギ:U+30AE ン:U+30F3 ところでペンギンの「ペ」と「ギ」は半濁点および濁点を含む。 Unicode は「ペ」と「ギ」をそれぞれ2つの要素に分解できる。 ペ:U+30D8 + U+309A ン:U+30F3 ギ:U+30AD + U+3099 ン:U+30F3 U+309A および U+3099 はそれぞれ半濁点と濁点を表す「結合文字(combining character)」である。 「ヘ」や「キ」のような「基底文字(base character)」に結合文字を1つ以上1 付加した文字を「合成列(composite
This may come as a surprise for many people, but I do a large portion of my data science work in Go. I recently gave a talk on why I use Go for data science. The slides are here, and I’d also like to expand on a few more things after the jump: The Cheatsheet I wrote up a cheatsheet for anyone coming from Python, and are used to using Numpy. I specifically want to thank Brendan Tracey, Sebastian Bi
integralist Compassionate Listener. Polyglot. Author. Husband. Father. He/Him. Memory Management Types of Profiling Tools Matrix Analysis Steps Base Example ReadMemStats Pprof Trace Conclusion Note: I highly recommend also reading this official diagnostics documentation. Memory Management Before we dive into the techniques and tools available for profiling Go applications, we should first understa
August 15, 2013Understanding Slices in Go Programming Since I started programming in Go the concept and use of slices has been confusing. This is something completely new to me. They look like an array, and feel like an array, but they are much more than an array. I am constantly reading how slices are used quite a bit by Go programmers and I think it is finally time for me to understand what slic
I am new to the Go programming language and I have an assignment to create and interpreter but I am running into the following problem: I want to define an Environment as: type Environment struct{ parent Environment symbol string value RCFAEValue } func (env Environment) lookup(lookupSymbol string) RCFAEValue{ if lookupSymbol == env.symbol{ return env.value } //if parent != nill { return env.paren
Anthony Starks has remixed my original Google Present based slides using his fantastic Deck presentation tool. You can check out his remix over on his blog, mindchunk.blogspot.com.au/2014/06/remixing-with-deck. I was recently invited to give a talk at Gocon, a fantastic Go conference held semi-annually in Tokyo, Japan. Gocon 2014 was an entirely community-run one day event combining training and a
This tool instantly converts JSON into a Go type definition. Paste a JSON structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output! For an example, try converting JSON from the SmartyStreets API or the GitHub API. © 2015 Matt Holt (@mholt6) • View on GitHub • Dark mode
golang のテストツールには標準でベンチマークツールが付属しています。例えば、引数 n を貰ってその数分だけメッセージの入ったスライスを返す関数 makeSlice が以下の実装だったとします。 foo.go package foo import "fmt" func makeSlice(n int) []string { var r []string for i := 0; i < n; i++ { r = append(r, fmt.Sprintf("%03d だよーん", i)) } return r } 如何にも遅そうなコードですね。まずはこのコードを単品で計測するベンチマークを書きます。 foo_test.go package foo import "testing" func BenchmarkMakeSlice(b *testing.B) { b.ResetTimer()
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く