March 2019
Intermediate to advanced
336 pages
9h 9m
English
A unit test for the MapLayout class's NewMapLayout method is shown in the following code snippet:
///main package has examples shown// in Go Data Structures and algorithms bookpackage main// importing testing packageimport ( "testing")// NewMapLayout test methodfunc TestNewMapLayout(test *testing.T) { var mapLayout *MapLayout mapLayout = NewMapLayout() test.Log(mapLayout) if mapLayout == nil { test.Errorf("error in creating a mapLayout") }}
Run the following command to execute the preceding code snippet:
go test -run NewMapLayout -v
The output is as follows:

The next section talks about implementing a knowledge graph.
Read now
Unlock full access