GithubHelp home page GithubHelp logo

go-playground's Introduction

go-playground

build

docker-compose build

run

docker-compose up -d docker exec -it goplayground_app_1 go run study.go docker exec -it goplayground_app_1 go test packageName

キーワード

  • type キーワードによる型宣言
  • strutキーワードを使った構造体
  • 関数のレシーバ型
  • newを利用したメモリ確保
  • ...型名 での可変長引数

ダックタイピング

インタフェースが必要とするメソッドをすべて実装した時点で、自動的にそのインタフェースを実装したとみなされます。

文法

  • := は関数ないに限り使用可能
  • deferによる遅延実行

演算子

http://cuto.unirita.co.jp/gostudy/post/go-operator/

アドレス演算子

  • & 右辺の変数のアドレスを得る
    • 右辺の変数に格納されたアドレスを解決する

ユニットテスト

  • assertは無い
  • *_test.go というファイル名

送受信演算子

  • <- 左辺のチェネルへ右辺の値を送信する
  • =<- 右辺のチェネルから値を受信する

パッケージ

  • 名前空間を分けるためにpackageを利用する
  • importで使用する
  • 大文字で始まるものはimportで参照可能なパブリックメンバ
  • 小文字で始まるものはimportでも参照不可能なプライベートメンバ

TODO

  • Study testing framework
  • create cli sample

reference

http://cuto.unirita.co.jp/gostudy/

go-playground's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.