mirror of
				https://github.com/maride/pancap.git
				synced 2025-10-10 19:36:51 +00:00 
			
		
		
		
	Cleanup and go fmt
This commit is contained in:
		
							parent
							
								
									4a1c58b564
								
							
						
					
					
						commit
						1aa3572c30
					
				| @ -1,42 +0,0 @@ | ||||
| package main | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/google/gopacket" | ||||
| 	"github.com/google/gopacket/layers" | ||||
| 	"testing" | ||||
| ) | ||||
| 
 | ||||
| func Test_analyzePCAP(t *testing.T) { | ||||
| 	type args struct { | ||||
| 		source   *gopacket.PacketSource | ||||
| 		linkType layers.LinkType | ||||
| 	} | ||||
| 	tests := []struct { | ||||
| 		name    string | ||||
| 		args    args | ||||
| 		wantErr bool | ||||
| 	}{ | ||||
| 		{ | ||||
| 			name: "Faulty link type", | ||||
| 			args: args{ | ||||
| 				source: &gopacket.PacketSource{ | ||||
| 					DecodeOptions: gopacket.DecodeOptions{ | ||||
| 						Lazy:                     false, | ||||
| 						NoCopy:                   false, | ||||
| 						SkipDecodeRecovery:       false, | ||||
| 						DecodeStreamsAsDatagrams: false, | ||||
| 					}, | ||||
| 				}, | ||||
| 				linkType: 2, | ||||
| 			}, | ||||
| 			wantErr: true, | ||||
| 		}, | ||||
| 	} | ||||
| 	for _, tt := range tests { | ||||
| 		t.Run(tt.name, func(t *testing.T) { | ||||
| 			if err := analyzePCAP(tt.args.source, tt.args.linkType); (err != nil) != tt.wantErr { | ||||
| 				t.Errorf("analyzePCAP() error = %v, wantErr %v", err, tt.wantErr) | ||||
| 			} | ||||
| 		}) | ||||
| 	} | ||||
| } | ||||
| @ -2,11 +2,12 @@ package output | ||||
| 
 | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"github.com/maride/pancap/common" | ||||
| 	"io/ioutil" | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"strings" | ||||
| 
 | ||||
| 	"github.com/maride/pancap/common" | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user