-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Denis Krivak
committed
May 16, 2020
1 parent
570b502
commit e954f0a
Showing
9 changed files
with
352 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Package comment without a period FAIL. | ||
package example | ||
|
||
/* | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
void myprint(char* s) { | ||
printf("%d\n", s); | ||
} | ||
# PASS | ||
*/ | ||
import "C" | ||
import "unsafe" | ||
|
||
//args: tagged comment without period PASS | ||
|
||
// #tag hashtag comment without period PASS | ||
|
||
/* | ||
Multiline comment without a period FAIL. | ||
*/ | ||
|
||
/* | ||
Multiline comment with a period PASS. | ||
*/ | ||
|
||
/* One-line comment without a period FAIL. */ | ||
|
||
/* One-line comment with a period PASS. */ | ||
|
||
// Single-line comment without a period FAIL. | ||
|
||
// Single-line comment with a period PASS. | ||
|
||
// Declaration comment without a period FAIL. | ||
type SimpleObject struct { | ||
// Exported field comment - always PASS | ||
Type string | ||
// Unexported field comment - always PASS | ||
secret int | ||
} | ||
|
||
// Declaration comment without a period, with an indented code example: | ||
// co := ComplexObject{} | ||
// fmt.Println(co) // PASS | ||
type ComplexObject struct { | ||
// Exported field comment - always PASS | ||
Type string | ||
// Unexported field comment - always PASS | ||
secret int | ||
} | ||
|
||
// Declaration comment without a period, with a mixed indented code example: | ||
// co := Message{} | ||
// fmt.Println(co) // PASS | ||
type Message struct { | ||
Type string | ||
} | ||
|
||
// Declaration multiline comment | ||
// second line | ||
// third line with a period PASS. | ||
func Sum(a, b int) int { | ||
// Inner comment - always PASS | ||
a++ | ||
b++ | ||
|
||
return a + b // inline comment - always PASS | ||
} | ||
|
||
// Declaration multiline comment | ||
// second line | ||
// third line without a period FAIL. | ||
func Mult(a, b int) int { | ||
return a * b | ||
} | ||
|
||
//export CgoExportedFunction PASS | ||
func CgoExportedFunction(a, b int) int { | ||
return a + b | ||
} | ||
|
||
func noComment() { | ||
cs := C.CString("Hello from stdio\n") | ||
C.myprint(cs) | ||
C.free(unsafe.Pointer(cs)) | ||
} | ||
|
||
// Comment with a URL - http://example.com/PASS |
File renamed without changes.
Oops, something went wrong.