//golangcitest:args -Eerrchkjson
//golangcitest:config_path testdata/errchkjson.yml
package testdata

/*
 #include <stdio.h>
 #include <stdlib.h>

 void myprint(char* s) {
 	printf("%d\n", s);
 }
*/
import "C"

import (
	"encoding/json"
	"unsafe"
)

func _() {
	cs := C.CString("Hello from stdio\n")
	C.myprint(cs)
	C.free(unsafe.Pointer(cs))
}

func _() {
	var err error

	_, _ = json.Marshal(nil)   // want "Error return value of `encoding/json.Marshal` is not checked"
	json.Marshal(nil)          // want "Error return value of `encoding/json.Marshal` is not checked"
	_, err = json.Marshal(nil) // nil is safe and check-error-free-encoding is false
	_ = err
}
