1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-23 20:02:22 +00:00

add copyright

This commit is contained in:
chai2010 2018-01-09 16:24:22 +08:00
parent 4a31483164
commit f16ece9385
38 changed files with 113 additions and 0 deletions

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import "fmt"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
func main()

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "textflag.h"
#include "funcdata.h"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
// #include <stdio.h>

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include <iostream>
void SayHello() {

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
// +build ignore
package main

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
%module main
%inline %{

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
//#include <stdio.h>

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
/*

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include <stdio.h>
void SayHello(const char* s) {

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
//void SayHello(const char* s);

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
/*

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
//void SayHello(char* s);

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
//#include <stdio.h>

View File

@ -1 +1,4 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "./my_buffer.h"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import "unsafe"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include <string>
struct MyBuffer {

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "./my_buffer.h"
extern "C" {

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
/*

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
typedef struct MyBuffer_T MyBuffer_T;
MyBuffer_T* NewMyBuffer(int size);

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "person.h"
#include <stdio.h>

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
// #cgo CXXFLAGS: -std=c++11

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
type Person struct {

View File

@ -1 +1,4 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "person.h"

View File

@ -1,3 +1,5 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
extern "C" {
#include "./person_capi.h"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
//#include "./person_capi.h"

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include <stdint.h>
typedef uintptr_t person_handle_t;

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import "C"

View File

@ -1,3 +1,6 @@
# Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
default:
go build -buildmode=c-shared -o gopkg.so main.go
python3 -c 'import gopkg; print(gopkg.system("time"))'

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
/*

View File

@ -1,3 +1,6 @@
# Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
default:
go build -buildmode=c-shared -o say-hello.so main.go
gcc -Wall _test_so.c ./say-hello.so

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
#include "say-hello.h"
#include <stdio.h>

View File

@ -1,3 +1,6 @@
# Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
from ctypes import *
libso = CDLL("./say-hello.so")

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import "C"

View File

@ -1,2 +1,5 @@
# Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
# License: https://creativecommons.org/licenses/by-nc-sa/4.0/
default:
go tool cgo hello.go

View File

@ -1,3 +1,6 @@
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
package main
import "C"