jsonnocomment

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2020 License: MIT, MIT Imports: 1 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFileAndCleanComment

func ReadFileAndCleanComment(pathFile string) (cleanFile []byte, err error)

ReadFileAndCleanComment - Функция чтения JSON файла и удаления из него закоментированных строк и блок (комментарии согласно правилам С/С++)

Example

Простой пример использования

// file: testFile.json:
//`{
//  "name": "test */JSON file/",
//  //"comment_line": "not /see this line of //text /*comment too */",/
//  /*"comment_block": "not see *this* block of //text",*/
//  "end": "end/ json /file*"
//}//`

bytes, err := ReadFileAndCleanComment("./test_json/testFile.json")
if err != nil {
	print("Unexpected error while Read and Clean Json file: %v", err)
}
fmt.Println(string(bytes)) 
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL