You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/31 14:10:21 UTC

[GitHub] utzig commented on a change in pull request #260: `$import` directive

utzig commented on a change in pull request #260: `$import` directive
URL: https://github.com/apache/mynewt-newt/pull/260#discussion_r252680926
 
 

 ##########
 File path: util/fileinfo.go
 ##########
 @@ -0,0 +1,42 @@
+package util
+
+import (
+	"fmt"
+)
+
+// FileInfo represents a configuration source.  It is intended to help the user
+// understand how the system acquired its configuration, and to aid in tracking
+// down errors in configuration files.
+type FileInfo struct {
+	Path   string    // Path of configuration file.
+	Parent *FileInfo // File that imported this configuration file, if any.
+}
+
+// ImportString creates a string describing the import hierarchy of the given
+// FileInfo.  It should be called on the *parent* of the file of interest.
+func (fi *FileInfo) ImportString() string {
+	s := ""
+
+	first := true
+	for fi != nil {
+		if !first {
 
 Review comment:
   if `first` starts with `true` will the contents of this `if` ever execute?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services