Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 1.17 KB

result.md

File metadata and controls

69 lines (52 loc) · 1.17 KB

A hello world in Go

Go is very simple, here you can see a whole "hello, world" program.

// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

package main

import (
	"fmt"
	"time"
)

func main() {
	fmt.Println("Hello, there, it is", time.Now())
}

We can try to embed a file from a directory.

func main() {
	fmt.Println("Hello, there, it is", time.Now())
}

You always start with a package statement like:

package main

Followed by an import statement:

import (
	"fmt"
	"time"
)

You can also see how to get the current time:

embedmd:# (hello.go /time.[^)]*)/)

time.Now()

You can also have some extra code independent from embedmd

print 'hello'

And why not include some file directly from GitHub?

func main() {
	fmt.Println("Hello, there, it is", time.Now())
}