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

The next section talks about the representation of ...
Read now
Unlock full access