Skip to content

Instantly share code, notes, and snippets.

package display
// All functions which can be called from templates resides here.
import (
"github.com/opesun/hypecms/api/context"
"github.com/opesun/hypecms/model/scut"
"github.com/opesun/hypecms/modules/user"
"github.com/opesun/jsonp"
"github.com/opesun/numcon"
// In package btree:
type Comper interface {
Less(Comper) bool
Eq(Comper) bool
}
==============================================
type Int int
func (i Int) Less(c btree.Comper) bool {
{
"sidebar_msg": "$welcome"
"non_multilingual_field": "whatever"
}
package main
import(
"launchpad.netv2/mgo/v2"
"launchpad.netv2/mgo/v2/bson"
"fmt"
"reflect"
)
func main() {
func l (run
recover (+ 1 1)
println "Just a casual println..."
panic "Get out of here."
println "This shall not run.")
println (l)
println "Recovered"
Produces:
-- This is a comment
set n (+ 2 4)
set x 8
if (< n x) (
println "Multiline if."
println "n is smaller than " x
)
println "n is greater or equal than " x
for x
println "n is " n
package main
func wut( x int ) int {
if x % 2 == 0 {
return 1;
} else {
return 2;
}
}
for ( var i = 0; i < zillion; i++ )
{
async_func(); // <-- i must wait for this to return before proceeding in the for loop. :(
}