Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 11, 2015

Kiểm tra dữ liệu trong golang

Trong php tôi thường sử dụng gettype() để kiểm tra xem dữ liệu đang dùng là integer hay anything else gì đó còn trong golang hơi dài dòng chút phải sử dụng package "reflect". see this code in play.golang.org

What are the best web frameworks for Go

I  recommend just using the net/http package in the standard library to start. And if you want help with request routing we recommend looking at Gorilla and Gocraft/web . Both Revel and Martini have too much dependency injection and other magic to make us feel comfortable. Gorilla is the most minimal. All of the frameworks we looked at are built on top of the net/http package. So, check on this pages show your choices http://www.slant.co/topics/1412/compare/~martini_vs_revel_vs_beego

Sublime Text with Golang

Install Sublime Text  Download sublime text from home page http://www.sublimetext.com/ Install PackageControl Flow struction in this page : https://packagecontrol.io/installation Add plugin Ctrl + Shift + P / Command + Shift  + PP Typing :  GoSublime Install Path  Install Go : https://golang.org/dl/ Add GoImport  from command: go get -u golang.org/x/tools/cmd/goimports Active setting :  Preferences -> Package Settings ->  GoSublime  -> Settings - User Paste :  {     "env": {         "GOPATH": "$HOME/Documents/go:$GS_GOPATH",         "GOROOT": "/usr/local/go/"     },     "fmt_cmd": ["goimports"] } 

Testing trong Go

Package :  " go get github.com/bmizerany/assert " Using point.go package point type Point struct { x, y int } point_test.go package point import ( "testing" "github.com/bmizerany/assert" ) func TestAsserts(t *testing.T) { p1 := Point{1, 1} p2 := Point{2, 1} assert.Equal(t, p1, p2) }

Loop in Go lang

The only way to work with Loops in go lang via "for" Như vậy cũng tốt  hơn rất nhiều, ko phải quan tâm nhiều về while,do while for i<= 3{   fmt.Println(i)   i= i+1   }   for j:=7; j<=9; j++{   fmt.Println(j)   }   for {   fmt.Println("loop")   break   }

Go by Example for Beginner

Phần cài đặt mình không nói nữa có bài trong series học Go trong http://kipalog.com/ Phần này mình giới thiệu  thêm tài liệu học Go. Web practice:  https://gobyexample.com/ ||  https://www.golang-book.com Docs:google search nếu không thấy có thể contact skype: smagic39 Buid web application with golang Building web apps with go Go Programming in Go

Go language tool

So simple everything you need ! Đơn giản gọn nhẹ , tiện như brew, grunt https://github.com/moovweb/gvm Features Install/Uninstall Go versions with  gvm install [tag]  where tag is "60.3", "go1", "weekly.2011-11-08", or "tip" List added/removed files in GOROOT with  gvm diff Manage GOPATHs with  gvm pkgset [create/use/delete] [name] . Use  --local  as  name  to manage repository under local path ( /path/to/repo/.gvm_local ). List latest release tags with  gvm listall . Use  --all  to list weekly as well. Cache a clean copy of the latest Go source for multiple version installs. Link project directories into GOPATH

Sass theo tiến trình nó là vậy

Các khái niệm OOP, MVC, Frameowork đã quen thuộc với đân lập trình. Hướng cho ngôn ngữ lập trình ngày càng dễ dàng hơn. Nhiều năm trước , lúc ra trường (2011) cũng nhen nhóm nếu JS nó giống PHP hoặc Java tống hết vào OOP và MVC thì có phải dễ dàng hơn khi snippet hay autocomplete . Rồi angular hay vài mvc js ra đời thì đó ko còn là điều hoang tưởng cũng như version mới mà W3C công bố cho js thì Object đã ngon với js. Mải mổ củi với css ko để ý technical lắm.Rỗi rỗi đọc full stack gặp sass . Một cải tiến mới trong tâm trí lập trình  http://sass-lang.com/, giống như sơ đẳng của lập trình js, còn sơ khai nhưng hi vọng càng về sau. tính flexible với OOP sẽ càng rõ rệt hoặc sass sẽ chết một css oop  mới ra đời . Nhưng hiện tại hài lòng với sass.