- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for parseGlob (0.21 sec)
-
src/text/template/helper.go
// the last one mentioned will be the one that results. func (t *Template) ParseGlob(pattern string) (*Template, error) { t.init() return parseGlob(t, pattern) } // parseGlob is the implementation of the function and method ParseGlob. func parseGlob(t *Template, pattern string) (*Template, error) { filenames, err := filepath.Glob(pattern) if err != nil { return nil, err
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 21:54:08 UTC 2024 - 6.4K bytes - Viewed (0) -
src/html/template/examplefiles_test.go
pattern := filepath.Join(dir, "*.tmpl") // Here starts the example proper. // T0.tmpl is the first name matched, so it becomes the starting template, // the value returned by ParseGlob. tmpl := template.Must(template.ParseGlob(pattern)) err := tmpl.Execute(os.Stdout, nil) if err != nil { log.Fatalf("template execution: %s", err) } // Output: // T0 invokes T1: (T1 invokes T2: (This is T2)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Dec 09 19:12:23 UTC 2020 - 7.5K bytes - Viewed (0) -
src/text/template/examplefiles_test.go
pattern := filepath.Join(dir, "*.tmpl") // Here starts the example proper. // T0.tmpl is the first name matched, so it becomes the starting template, // the value returned by ParseGlob. tmpl := template.Must(template.ParseGlob(pattern)) err := tmpl.Execute(os.Stdout, nil) if err != nil { log.Fatalf("template execution: %s", err) } // Output: // T0 invokes T1: (T1 invokes T2: (This is T2)) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Dec 09 19:12:23 UTC 2020 - 6.1K bytes - Viewed (0) -
src/html/template/multi_test.go
} func TestParseGlob(t *testing.T) { _, err := ParseGlob("DOES NOT EXIST") if err == nil { t.Error("expected error for non-existent file; got none") } _, err = New("error").ParseGlob("[x") if err == nil { t.Error("expected error for bad pattern; got none") } template := New("root") _, err = template.ParseGlob("testdata/file*.tmpl") if err != nil { t.Fatalf("error parsing files: %v", err)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 15:48:16 UTC 2022 - 8K bytes - Viewed (0) -
src/html/template/template_test.go
t.Errorf("ParseFiles: %v\nwanted error about already having Executed", err) } if _, err := c.root.ParseGlob("*.no.template"); err == nil || !strings.Contains(err.Error(), "Execute") { t.Errorf("ParseGlob: %v\nwanted error about already having Executed", err) } if _, err := c.root.AddParseTree("t1", c.root.Tree); err == nil || !strings.Contains(err.Error(), "Execute") {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 15:48:16 UTC 2022 - 6.2K bytes - Viewed (0) -
src/text/template/template.go
m = append(m, v) } return m } // Delims sets the action delimiters to the specified strings, to be used in // subsequent calls to [Template.Parse], [Template.ParseFiles], or [Template.ParseGlob]. Nested template // definitions will inherit the settings. An empty delimiter stands for the // corresponding default: {{ or }}. // The return value is the template, so calls can be chained.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:57:51 UTC 2024 - 7.2K bytes - Viewed (0) -
cni/pkg/log/uds_test.go
i := 0 for _, l := range gotLogs { var parsedLog map[string]any assert.NoError(t, json.Unmarshal([]byte(l), &parsedLog)) if parsedLog["scope"] != "cni-plugin" { // Each log is 2x: one direct, and one over UDS. Just test the UDS one continue } // remove scope since it is constant and not needed to test delete(parsedLog, "scope") // check time is there if _, f := parsedLog["time"]; !f {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Jun 12 16:26:28 UTC 2024 - 4.1K bytes - Viewed (0) -
tools/bug-report/pkg/processlog/processlog.go
func getTimeRange(logStr string, start, end time.Time) string { var sb strings.Builder write := false for _, l := range strings.Split(logStr, "\n") { t, _, _, valid := parseLog(l) if valid { write = false if (t.Equal(start) || t.After(start)) && (t.Equal(end) || t.Before(end)) { write = true } } if write { sb.WriteString(l) sb.WriteString("\n") }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri May 19 21:44:33 UTC 2023 - 4.4K bytes - Viewed (0)