Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Dec 3, 2018
1 parent 3d333db commit 66cde18
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/walkers/ident/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ import (
//
// Users can call the Walk method to check and replace identifiers.
//
// newTree, err = ident.Walk(tree, map[string]string)
// Example:
//
// // Check and replace user identifiers with the SQL table column names.
// //
// // SQL table columns are "title, author, pages and rating", but for
// // users pages and ratings are fields of an internal struct called
// // spec (e.g. {"title": "Book", "author": "Joe", "spec": {"pages": 5, "rating": 5}}).
// //
// newTree, err = ident.Walk(tree, map[string]string{
// "title": "title",
// "author": "author",
// "spec.pages": "pages",
// "spec.rating": "rating",
// })
//
func Walk(n tsl.Node, identMap map[string]string) (tsl.Node, error) {
var err error
Expand Down

0 comments on commit 66cde18

Please sign in to comment.