“go”语句会在一个独立的控制线程(或goroutine)中执行一个方法(在相同的地址究竟内部)。
GoStmt = "go" Expression .
expression表达式必须是一个方法或一个函数。内建方法被限制用于expression表达式。
// Call Chrome API | |
function MyController($scope){ | |
chrome.bookmarks.getTree(function(tree){ | |
// Here MUST use $scope.$apply() for Render the data updated to View. | |
$scope.$apply(function(){ | |
$scope.tree = tree[0].children; | |
}); | |
}); | |
} |
// app.js | |
angular.module("myApp", []). | |
controller("TreeController", ['$scope', function($scope) { | |
$scope.delete = function(data) { | |
data.nodes = []; | |
}; | |
$scope.add = function(data) { | |
var post = data.nodes.length + 1; | |
var newName = data.name + '-' + post; | |
data.nodes.push({name: newName,nodes: []}); |
package main | |
import ( | |
"github.com/nsf/termbox-go" | |
"log" | |
) | |
func draw(ch rune) { | |
w, h := termbox.Size() | |
bg := termbox.ColorBlack |
AngularJS Using Filter |
JavaScript GOF |
Algorithms using Golang |
AngularJS Using Services |
Javascript Buildin Object/Function |
Golang Static File Server |