Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/commander/commander.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package commander

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"net"
Expand Down
2 changes: 0 additions & 2 deletions app/dispatcher/default.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dispatcher

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"regexp"
Expand Down
2 changes: 0 additions & 2 deletions app/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package dispatcher

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/dns/dns.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Package dns is an implementation of core.DNS feature.
package dns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"fmt"
Expand Down
2 changes: 0 additions & 2 deletions app/dns/fakedns/fakedns.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package fakedns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/log/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions app/log/log.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package log

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"fmt"
Expand Down
2 changes: 0 additions & 2 deletions app/observatory/burst/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"time"
)

//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

const (
rttFailed = time.Duration(math.MaxInt64 - iota)
rttUntested
Expand Down
2 changes: 0 additions & 2 deletions app/observatory/observatory.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package observatory

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/policy/policy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package policy is an implementation of policy.Manager feature.
package policy

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/proxyman/command/doc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions app/proxyman/inbound/inbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package inbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync"
Expand Down
2 changes: 0 additions & 2 deletions app/proxyman/outbound/outbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package outbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sort"
Expand Down
2 changes: 0 additions & 2 deletions app/reverse/reverse.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package reverse

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions app/router/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"time"
Expand Down
2 changes: 0 additions & 2 deletions app/router/router.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package router

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
sync "sync"
Expand Down
2 changes: 0 additions & 2 deletions app/stats/command/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package command

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"runtime"
Expand Down
2 changes: 0 additions & 2 deletions app/stats/stats.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package stats

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync"
Expand Down
2 changes: 0 additions & 2 deletions common/buf/buf.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package buf provides a light-weight memory allocation mechanism.
package buf // import "github.com/xtls/xray-core/common/buf"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

// ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route.
var ErrNoClue = errors.New("not enough information for making a decision")

Expand Down
2 changes: 0 additions & 2 deletions common/crypto/crypto.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package crypto provides common crypto libraries for Xray.
package crypto // import "github.com/xtls/xray-core/common/crypto"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/drain/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package drain

import "io"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

type Drainer interface {
AcknowledgeReceive(size int)
Drain(reader io.Reader) error
Expand Down
9 changes: 9 additions & 0 deletions common/errors/feature_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import (
"context"
)

// PrintMigrateFeatureInfo prints a notice of the upcoming feature migration.
// Place it after the source feature related config file pharser code.
// Important note: Only use this when the target migrating feature is under construction.
// Important note: Even when the target migrating feature has finished its construction, this notice can still be used yet before announcing deprecation of the old feature.
// Do not remove this function even there is no reference to it.
func PrintMigrateFeatureInfo(sourceFeature string, targetFeature string) {
LogInfo(context.Background(), "The feature " + sourceFeature + " will be migrated to " + targetFeature + " in the future.")
}

// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
// Do not remove this function even there is no reference to it.
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
Expand Down
2 changes: 0 additions & 2 deletions common/mux/mux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package mux

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/net/net.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package net is a drop-in replacement to Golang's net package, with some more functionalities.
package net // import "github.com/xtls/xray-core/common/net"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
17 changes: 6 additions & 11 deletions common/net/network.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion common/net/network.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ option java_multiple_files = true;
enum Network {
Unknown = 0;

RawTCP = 1 [deprecated = true];
TCP = 2;
UDP = 3;
UNIX = 4;
Expand Down
2 changes: 0 additions & 2 deletions common/platform/ctlcmd/ctlcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/xtls/xray-core/common/platform"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
xctl := platform.GetToolLocation("xctl")
if _, err := os.Stat(xctl); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions common/protocol/protocol.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package protocol // import "github.com/xtls/xray-core/common/protocol"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions common/protocol/tls/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
"github.com/xtls/xray-core/common/errors"
)

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

type Certificate struct {
// certificate in ASN.1 DER format
Certificate []byte
Expand Down
2 changes: 0 additions & 2 deletions common/retry/retry.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package retry // import "github.com/xtls/xray-core/common/retry"

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"time"

Expand Down
2 changes: 0 additions & 2 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// connections.
package core

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"fmt"
"runtime"
Expand Down
2 changes: 0 additions & 2 deletions features/routing/dns/context.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dns

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions features/stats/stats.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package stats

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"

Expand Down
2 changes: 0 additions & 2 deletions infra/conf/conf.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package conf

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions infra/conf/serial/serial.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package serial

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions main/commands/all/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/xtls/xray-core/main/commands/base"
)

// go:generate go run github.com/xtls/xray-core/common/errors/errorgen

func init() {
base.RootCommand.Commands = append(
base.RootCommand.Commands,
Expand Down
2 changes: 0 additions & 2 deletions main/confloader/external/external.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package external

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"bytes"
"io"
Expand Down
2 changes: 0 additions & 2 deletions proxy/blackhole/blackhole.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Package blackhole is an outbound handler that blocks all connections.
package blackhole

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"time"
Expand Down
2 changes: 0 additions & 2 deletions proxy/dokodemo/dokodemo.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dokodemo

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"sync/atomic"
Expand Down
2 changes: 0 additions & 2 deletions proxy/freedom/freedom.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package freedom

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"context"
"crypto/rand"
Expand Down
2 changes: 0 additions & 2 deletions proxy/http/http.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package http

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/loopback/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package loopback

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/shadowsocks/shadowsocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
//
// R.I.P Shadowsocks
package shadowsocks

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/shadowsocks_2022/shadowsocks_2022.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package shadowsocks_2022

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/socks/socks.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Package socks provides implements of Socks protocol 4, 4a and 5.
package socks

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/trojan/trojan.go
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
package trojan

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
2 changes: 0 additions & 2 deletions proxy/vless/encoding/encoding.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package encoding

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"bytes"
"context"
Expand Down
2 changes: 0 additions & 2 deletions proxy/vless/inbound/inbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package inbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"bytes"
"context"
Expand Down
2 changes: 0 additions & 2 deletions proxy/vless/outbound/outbound.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package outbound

//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

import (
"bytes"
"context"
Expand Down
Loading