双方とも等価なのでどちらでもいい。英語としてスムーズな方を使うべき。 http://qiita.com/jnchito/items/1e6f8374e22dbd430e17
ビルドして実行
$ go run foo.go
コードのフォーマット 上と下は同じ意味。gofmtはオプションをより詳細に指定したいときに使う。
``
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| s := []rune("パタトクカシーー") | |
| result := make([]rune, 4) | |
| l := len(result) | |
| for i, j := 0, 0; i < l; i, j = i+1, j+2 { | |
| result[i] = s[j] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println(reverse("stressed")) | |
| } | |
| func reverse(s string) string { | |
| src := []rune(s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Cookbook Name:: COOKBOOK_NAME | |
| # Recipe:: default | |
| # | |
| # Copyright 2014, YOUR_COMPANY_NAME | |
| # | |
| # All rights reserved - Do Not Redistribute | |
| # | |
| yum_repository "mongodb" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| require 'mechanize' | |
| # 以下を参考にさせていただきました | |
| # http://qiita.com/kazuph/items/57103dde7f4e4a0c4ff1 | |
| BASE_URL= 'https://foo.backlog.jp' | |
| PROJECT_NAME = 'project_name' | |
| USER_ID = 'user_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| require 'xmlrpc/client' | |
| HOST = 'foo.backlog.jp' | |
| PATH = '/XML-RPC' | |
| PORT = '443' | |
| USER = 'user' | |
| PASSWORD = 'password' | |
| USE_SSL = true | |
| TIMEOUT = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| import boto.elastictranscoder | |
| AWS_KEY_ID = 'aws_key_id' | |
| AWS_SECRET_KEY = 'aws_secret_key' | |
| transcode = boto.elastictranscoder.connect_to_region('ap-northeast-1', aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET_KEY) | |
| pipeline_id = 'pipeline_id' |