()
| 1073 | } |
| 1074 | |
| 1075 | func ExampleProgramSpec_Compatible() { |
| 1076 | spec := &ProgramSpec{ |
| 1077 | Type: SocketFilter, |
| 1078 | Instructions: asm.Instructions{ |
| 1079 | asm.LoadImm(asm.R0, 0, asm.DWord), |
| 1080 | asm.Return(), |
| 1081 | }, |
| 1082 | License: "MIT", |
| 1083 | } |
| 1084 | |
| 1085 | prog, _ := NewProgram(spec) |
| 1086 | info, _ := prog.Info() |
| 1087 | |
| 1088 | if err := spec.Compatible(info); err != nil { |
| 1089 | fmt.Printf("The programs are incompatible: %s\n", err) |
| 1090 | } else { |
| 1091 | fmt.Println("The programs are compatible") |
| 1092 | } |
| 1093 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…