example_01

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package example_01 contains a documentation example.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

type Msg struct {
	// Note is the note to be sent with the message.
	Note string
}

Msg represents a message.

func (*Msg) Receive

func (m *Msg) Receive(origin string)

Receive a message from a certain origin.

Example
package main

import (
	"github.com/juanmanuel-tirado/savetheworldwithgo/11_modules/godoc/example_01"
)

func main() {
	m := example_01.Msg{"Hello"}
	m.Receive("John")
}
Output:

Received Hello from John

func (*Msg) Send

func (m *Msg) Send(target string)

Send a message to a target destination.

Example
package main

import (
	"github.com/juanmanuel-tirado/savetheworldwithgo/11_modules/godoc/example_01"
)

func main() {
	m := example_01.Msg{"Hello"}
	m.Send("John")
}
Output:

Send Hello to John

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL