Skip to content

Commit

Permalink
Merge pull request #757 from manas-rust/patch-1
Browse files Browse the repository at this point in the history
Add ʕ◔ϖ◔ʔ option for golang, #757
  • Loading branch information
AlDanial authored Sep 8, 2023
2 parents 715884c + cf12acf commit 1590f7c
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
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 @@ -8333,6 +8333,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")
}

0 comments on commit 1590f7c

Please sign in to comment.