fix golint

This commit is contained in:
Tnze
2021-12-08 11:01:56 +08:00
parent bcae505a59
commit 4d0f7e7a7e
10 changed files with 1018 additions and 1013 deletions

View File

@ -1,6 +1,6 @@
# Go-MC
![Version](https://img.shields.io/badge/Minecraft-1.17.1-blue.svg)
![Version](https://img.shields.io/badge/Minecraft-1.18-blue.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/Tnze/go-mc.svg)](https://pkg.go.dev/github.com/Tnze/go-mc)
[![Go Report Card](https://goreportcard.com/badge/github.com/Tnze/go-mc)](https://goreportcard.com/report/github.com/Tnze/go-mc)
[![Build Status](https://travis-ci.org/Tnze/go-mc.svg?branch=master)](https://travis-ci.org/Tnze/go-mc)

View File

@ -16,8 +16,8 @@ import (
pk "github.com/Tnze/go-mc/net/packet"
)
// ProtocolVersion , the protocol version number of minecraft net protocol
const ProtocolVersion = 756
// ProtocolVersion is the protocol version number of minecraft net protocol
const ProtocolVersion = 757
const DefaultPort = 25565
// JoinServer connect a Minecraft server for playing the game.

View File

@ -1,3 +1,4 @@
//go:build generate
// +build generate
// gen_blocks.go generates block information.

View File

@ -1,3 +1,4 @@
//go:build generate
// +build generate
// gen_entity.go generates entity information.

View File

@ -1,3 +1,4 @@
//go:build generate
// +build generate
// gen_item.go generates item information.

View File

@ -1,3 +1,4 @@
//go:build generate
// +build generate
//gen_packetid.go generates the enumeration of packet IDs used on the wire.

View File

@ -1,3 +1,4 @@
//go:build generate
// +build generate
// gen_soundid.go generates the enumeration of sound IDs.

View File

@ -279,7 +279,7 @@ func parseTag(f reflect.StructField, v reflect.Value, tagName string) (result ta
}
nbtType := f.Tag.Get("nbt_type")
result.Type, v = getTagType(v)
result.Type, _ = getTagType(v)
if strings.Contains(nbtType, "list") {
if IsArrayTag(result.Type) {
result.Type = TagList // for expanding the array to a standard list

View File

@ -2,7 +2,7 @@ package server
import "github.com/Tnze/go-mc/net"
const ProtocolVersion = 756
const ProtocolVersion = 757
type Server struct {
ListPingHandler