diff --git a/main.go b/main.go index 18bb5a4..54f8459 100644 --- a/main.go +++ b/main.go @@ -317,7 +317,8 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by ".proto", ".rs", ".swift", - ".v", ".sv": + ".v", ".sv", + ".zig": lic, err = executeTemplate(tmpl, data, "", "// ", "") case ".awk", diff --git a/main_test.go b/main_test.go index 5adb4ed..ecb115d 100644 --- a/main_test.go +++ b/main_test.go @@ -340,6 +340,7 @@ func TestLicenseHeader(t *testing.T) { "f.rs", "f.swift", "f.v", "f.sv", + "f.zig", }, "// HYS\n\n", }, diff --git a/testdata/expected/file.zig b/testdata/expected/file.zig new file mode 100644 index 0000000..88ef9f8 --- /dev/null +++ b/testdata/expected/file.zig @@ -0,0 +1,19 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const std = @import("std"); + +pub fn main() void { + std.debug.print("Hello world!\n", .{}); +} diff --git a/testdata/initial/file.zig b/testdata/initial/file.zig new file mode 100644 index 0000000..d463fca --- /dev/null +++ b/testdata/initial/file.zig @@ -0,0 +1,5 @@ +const std = @import("std"); + +pub fn main() void { + std.debug.print("Hello world!\n", .{}); +}