Giter VIP home page Giter VIP logo

go-learn's Introduction

Belajar Golang by Noval Agung

list bab yang sudah di pelajari

  • goroutine seperti asynchronous dalam javascript . sebuah mini threading. See More

  • channel digunakan untuk menghubungkan goroutine satu dengan goroutine lain. See more

1. Conversion in Golang

a. tipe konversi data eksplisit

var x int = 10
var y float64 = float64(x) // Konversi int ke float64

var a int = 5
var b int64 = int64(a) // Konversi int ke int64

var s string = "123"
var i int = int(s) 
// error , tidak bisa langsung conver ke integer

b. konversi tipe data yang disediakan

import "strconv"

var s string = "123"
i, _ := strconv.Atoi(s) // Konversi string ke int

var i int = 123
s := strconv.Itoa(i) // Konversi int ke string

2 . Membuat Array atau Slice

// array 
var arr = [3]int{1,2,3}
// array di tentukan panjang datanya. tidak boleh melebihi panjang data yg sudah di tentukan

// slice
var arr = []int{1,2,3} 
// slice panjang data nya tidak di tentukan sehingga bebas mau memasukkan berapa data

3. Membuat Reflect

go-learn's People

Contributors

ariesdimasy avatar kunglaw avatar

Stargazers

Muhammad Ridwan Hakim avatar Jution Candra Kirana avatar Akmal  avatar Yusuf Ahmadi avatar

Watchers

James Cloos avatar  avatar

Forkers

rcdevgames

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.