Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ʕ◔ϖ◔ʔ option for golang #757

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Unix/t/00_C.t
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,16 @@ my @Tests = (
'ref' => '../tests/outputs/hello_app.go-2.yaml',
'args' => '--no-autogen ../tests/inputs/hello_app*.go',
},
{
'name' => 'Go',
'ref' => '../tests/outputs/hello_app.go-1.yaml',
'args' => '../tests/inputs/hello_app*.ʕ◔ϖ◔ʔ',
},
{
'name' => 'Go --no-autogen',
'ref' => '../tests/outputs/hello_app.go-2.yaml',
'args' => '--no-autogen ../tests/inputs/hello_app*.ʕ◔ϖ◔ʔ',
},
{
'name' => 'Godot Scene',
'ref' => '../tests/outputs/GamePanel.tscn.yaml',
Expand Down
3 changes: 2 additions & 1 deletion cloc
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@ sub exclude_autogenerated_files { # {{{1
print "-> exclude_autogenerated_files()\n" if $opt_v > 2;
my @file_list_minus_autogen = ();
foreach my $file (@{$ra_file_list}) {
if ($file !~ /\.go$/) {
if ($file !~ /\.go$/ && $file !~ /\.ʕ◔ϖ◔ʔ$/) {
# at the moment, only know Go autogenerated files
push @file_list_minus_autogen, $file;
next;
Expand Down Expand Up @@ -8294,6 +8294,7 @@ sub set_constants { # {{{1
'g4' => 'ANTLR Grammar' ,
'gleam' => 'Gleam' ,
'go' => 'Go' ,
'ʕ◔ϖ◔ʔ' => 'Go' ,
'gsp' => 'Grails' ,
'jenkinsfile' => 'Groovy' ,
'gvy' => 'Groovy' ,
Expand Down
34 changes: 34 additions & 0 deletions tests/inputs/hello_app.ʕ◔ϖ◔ʔ
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go
// Copyright 2015 Google Inc.
//
// 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.

// Package hello is a simple App Engine application that replies to requests
// on /hello with a welcoming message.
package hello

import (
"fmt"
"net/http"
)

// init is run before the application starts serving.
func init() {
// Handle all requests with path /hello with the helloHandler function.
http.HandleFunc("/hello", helloHandler)
}

func helloHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello from the Go app")
}

35 changes: 35 additions & 0 deletions tests/inputs/hello_app_autogen.ʕ◔ϖ◔ʔ
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Code generated by manual copy DO NOT EDIT.
// https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go
// Copyright 2015 Google Inc.
//
// 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.

// Package hello is a simple App Engine application that replies to requests
// on /hello with a welcoming message.
package hello

import (
"fmt"
"net/http"
)

// init is run before the application starts serving.
func init() {
// Handle all requests with path /hello with the helloHandler function.
http.HandleFunc("/hello", helloHandler)
}

func helloHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello from the Go app")
}