You've already forked crud_generator
							
							
				mirror of
				https://github.com/ManyakRus/crud_generator.git
				synced 2025-10-31 00:17:48 +02:00 
			
		
		
		
	сделал UUID
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -22,3 +22,4 @@ | ||||
| /bin/templates/configs_/.env_rapira | ||||
| /bin/templates/configs_/.env_test | ||||
| /bin/templates/configs_/.env0 | ||||
| /bin/notifier_service/ | ||||
|   | ||||
| @@ -1,15 +1,177 @@ | ||||
| //Файл создан автоматически кодогенератором crud_generator | ||||
| //Не изменяйте ничего здесь. | ||||
|  | ||||
| package crud_starter | ||||
|  | ||||
| import () | ||||
| import ( | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_attachament" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_channel" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_channel_prod" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_debt_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_debt_list2" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_delivery_error" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_delivery_status" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_filial" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_incoming_event" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_link_type" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_mailing" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_mailing_stats" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_message" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_meter_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_pdf_data" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_redirect_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_short_links" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_statistic" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_telegram_users" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_telegram_users_info" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_template" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_template_decoration" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_u_link_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_w_log" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_w_log_message_del" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/crud_starter/crud_starter_w_options" | ||||
|  | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_attachament" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_channel" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_channel_prod" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_debt_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_debt_list2" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_delivery_error" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_delivery_status" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_filial" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_incoming_event" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_link_type" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_mailing" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_mailing_stats" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_message" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_meter_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_pdf_data" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_redirect_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_short_links" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_statistic" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_telegram_users" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_telegram_users_info" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_template" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_template_decoration" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_u_link_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_w_log" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_w_log_message_del" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/db/crud/crud_w_options" | ||||
|  | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_attachament" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_channel" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_channel_prod" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_debt_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_debt_list2" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_delivery_error" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_delivery_status" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_filial" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_incoming_event" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_link_type" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_mailing" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_mailing_stats" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_message" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_meter_list" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_pdf_data" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_redirect_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_short_links" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_statistic" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_telegram_users" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_telegram_users_info" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_template" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_template_decoration" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_u_link_store" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_w_log" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_w_log_message_del" | ||||
| 	"gitlab.aescorp.ru/dsp_dev/claim/notifier_service/pkg/network/grpc/grpc_client/grpc_w_options" | ||||
| ) | ||||
|  | ||||
| // initCrudTransport_manual_DB - заполняет объекты crud для работы с БД напрямую | ||||
| func initCrudTransport_manual_DB() { | ||||
| 	crud_starter_attachament.SetCrudManualInterface(crud_attachament.Crud_DB{}) | ||||
| 	crud_starter_channel.SetCrudManualInterface(crud_channel.Crud_DB{}) | ||||
| 	crud_starter_channel_prod.SetCrudManualInterface(crud_channel_prod.Crud_DB{}) | ||||
| 	crud_starter_debt_list.SetCrudManualInterface(crud_debt_list.Crud_DB{}) | ||||
| 	crud_starter_debt_list2.SetCrudManualInterface(crud_debt_list2.Crud_DB{}) | ||||
| 	crud_starter_delivery_error.SetCrudManualInterface(crud_delivery_error.Crud_DB{}) | ||||
| 	crud_starter_delivery_status.SetCrudManualInterface(crud_delivery_status.Crud_DB{}) | ||||
| 	crud_starter_filial.SetCrudManualInterface(crud_filial.Crud_DB{}) | ||||
| 	crud_starter_incoming_event.SetCrudManualInterface(crud_incoming_event.Crud_DB{}) | ||||
| 	crud_starter_link_type.SetCrudManualInterface(crud_link_type.Crud_DB{}) | ||||
| 	crud_starter_mailing.SetCrudManualInterface(crud_mailing.Crud_DB{}) | ||||
| 	crud_starter_mailing_stats.SetCrudManualInterface(crud_mailing_stats.Crud_DB{}) | ||||
| 	crud_starter_message.SetCrudManualInterface(crud_message.Crud_DB{}) | ||||
| 	crud_starter_meter_list.SetCrudManualInterface(crud_meter_list.Crud_DB{}) | ||||
| 	crud_starter_pdf_data.SetCrudManualInterface(crud_pdf_data.Crud_DB{}) | ||||
| 	crud_starter_redirect_store.SetCrudManualInterface(crud_redirect_store.Crud_DB{}) | ||||
| 	crud_starter_short_links.SetCrudManualInterface(crud_short_links.Crud_DB{}) | ||||
| 	crud_starter_statistic.SetCrudManualInterface(crud_statistic.Crud_DB{}) | ||||
| 	crud_starter_telegram_users.SetCrudManualInterface(crud_telegram_users.Crud_DB{}) | ||||
| 	crud_starter_telegram_users_info.SetCrudManualInterface(crud_telegram_users_info.Crud_DB{}) | ||||
| 	crud_starter_template.SetCrudManualInterface(crud_template.Crud_DB{}) | ||||
| 	crud_starter_template_decoration.SetCrudManualInterface(crud_template_decoration.Crud_DB{}) | ||||
| 	crud_starter_u_link_store.SetCrudManualInterface(crud_u_link_store.Crud_DB{}) | ||||
| 	crud_starter_w_log.SetCrudManualInterface(crud_w_log.Crud_DB{}) | ||||
| 	crud_starter_w_log_message_del.SetCrudManualInterface(crud_w_log_message_del.Crud_DB{}) | ||||
| 	crud_starter_w_options.SetCrudManualInterface(crud_w_options.Crud_DB{}) | ||||
| } | ||||
|  | ||||
| // initCrudTransport_manual_GRPC - заполняет объекты crud для работы с БД напрямую | ||||
| // initCrudTransport_manual_GRPC - заполняет объекты crud для работы с БД через протокол GRPC | ||||
| func initCrudTransport_manual_GRPC() { | ||||
| 	crud_starter_attachament.SetCrudManualInterface(grpc_attachament.Crud_GRPC{}) | ||||
| 	crud_starter_channel.SetCrudManualInterface(grpc_channel.Crud_GRPC{}) | ||||
| 	crud_starter_channel_prod.SetCrudManualInterface(grpc_channel_prod.Crud_GRPC{}) | ||||
| 	crud_starter_debt_list.SetCrudManualInterface(grpc_debt_list.Crud_GRPC{}) | ||||
| 	crud_starter_debt_list2.SetCrudManualInterface(grpc_debt_list2.Crud_GRPC{}) | ||||
| 	crud_starter_delivery_error.SetCrudManualInterface(grpc_delivery_error.Crud_GRPC{}) | ||||
| 	crud_starter_delivery_status.SetCrudManualInterface(grpc_delivery_status.Crud_GRPC{}) | ||||
| 	crud_starter_filial.SetCrudManualInterface(grpc_filial.Crud_GRPC{}) | ||||
| 	crud_starter_incoming_event.SetCrudManualInterface(grpc_incoming_event.Crud_GRPC{}) | ||||
| 	crud_starter_link_type.SetCrudManualInterface(grpc_link_type.Crud_GRPC{}) | ||||
| 	crud_starter_mailing.SetCrudManualInterface(grpc_mailing.Crud_GRPC{}) | ||||
| 	crud_starter_mailing_stats.SetCrudManualInterface(grpc_mailing_stats.Crud_GRPC{}) | ||||
| 	crud_starter_message.SetCrudManualInterface(grpc_message.Crud_GRPC{}) | ||||
| 	crud_starter_meter_list.SetCrudManualInterface(grpc_meter_list.Crud_GRPC{}) | ||||
| 	crud_starter_pdf_data.SetCrudManualInterface(grpc_pdf_data.Crud_GRPC{}) | ||||
| 	crud_starter_redirect_store.SetCrudManualInterface(grpc_redirect_store.Crud_GRPC{}) | ||||
| 	crud_starter_short_links.SetCrudManualInterface(grpc_short_links.Crud_GRPC{}) | ||||
| 	crud_starter_statistic.SetCrudManualInterface(grpc_statistic.Crud_GRPC{}) | ||||
| 	crud_starter_telegram_users.SetCrudManualInterface(grpc_telegram_users.Crud_GRPC{}) | ||||
| 	crud_starter_telegram_users_info.SetCrudManualInterface(grpc_telegram_users_info.Crud_GRPC{}) | ||||
| 	crud_starter_template.SetCrudManualInterface(grpc_template.Crud_GRPC{}) | ||||
| 	crud_starter_template_decoration.SetCrudManualInterface(grpc_template_decoration.Crud_GRPC{}) | ||||
| 	crud_starter_u_link_store.SetCrudManualInterface(grpc_u_link_store.Crud_GRPC{}) | ||||
| 	crud_starter_w_log.SetCrudManualInterface(grpc_w_log.Crud_GRPC{}) | ||||
| 	crud_starter_w_log_message_del.SetCrudManualInterface(grpc_w_log_message_del.Crud_GRPC{}) | ||||
| 	crud_starter_w_options.SetCrudManualInterface(grpc_w_options.Crud_GRPC{}) | ||||
| } | ||||
|  | ||||
| // initCrudTransport_manual_NRPC - заполняет объекты crud для работы с БД напрямую | ||||
| // initCrudTransport_manual_NRPC - заполняет объекты crud для работы с БД через протокол NRPC | ||||
| func initCrudTransport_manual_NRPC() { | ||||
| } | ||||
| 	crud_starter_attachament.SetCrudManualInterface(grpc_attachament.Crud_GRPC{}) | ||||
| 	crud_starter_channel.SetCrudManualInterface(grpc_channel.Crud_GRPC{}) | ||||
| 	crud_starter_channel_prod.SetCrudManualInterface(grpc_channel_prod.Crud_GRPC{}) | ||||
| 	crud_starter_debt_list.SetCrudManualInterface(grpc_debt_list.Crud_GRPC{}) | ||||
| 	crud_starter_debt_list2.SetCrudManualInterface(grpc_debt_list2.Crud_GRPC{}) | ||||
| 	crud_starter_delivery_error.SetCrudManualInterface(grpc_delivery_error.Crud_GRPC{}) | ||||
| 	crud_starter_delivery_status.SetCrudManualInterface(grpc_delivery_status.Crud_GRPC{}) | ||||
| 	crud_starter_filial.SetCrudManualInterface(grpc_filial.Crud_GRPC{}) | ||||
| 	crud_starter_incoming_event.SetCrudManualInterface(grpc_incoming_event.Crud_GRPC{}) | ||||
| 	crud_starter_link_type.SetCrudManualInterface(grpc_link_type.Crud_GRPC{}) | ||||
| 	crud_starter_mailing.SetCrudManualInterface(grpc_mailing.Crud_GRPC{}) | ||||
| 	crud_starter_mailing_stats.SetCrudManualInterface(grpc_mailing_stats.Crud_GRPC{}) | ||||
| 	crud_starter_message.SetCrudManualInterface(grpc_message.Crud_GRPC{}) | ||||
| 	crud_starter_meter_list.SetCrudManualInterface(grpc_meter_list.Crud_GRPC{}) | ||||
| 	crud_starter_pdf_data.SetCrudManualInterface(grpc_pdf_data.Crud_GRPC{}) | ||||
| 	crud_starter_redirect_store.SetCrudManualInterface(grpc_redirect_store.Crud_GRPC{}) | ||||
| 	crud_starter_short_links.SetCrudManualInterface(grpc_short_links.Crud_GRPC{}) | ||||
| 	crud_starter_statistic.SetCrudManualInterface(grpc_statistic.Crud_GRPC{}) | ||||
| 	crud_starter_telegram_users.SetCrudManualInterface(grpc_telegram_users.Crud_GRPC{}) | ||||
| 	crud_starter_telegram_users_info.SetCrudManualInterface(grpc_telegram_users_info.Crud_GRPC{}) | ||||
| 	crud_starter_template.SetCrudManualInterface(grpc_template.Crud_GRPC{}) | ||||
| 	crud_starter_template_decoration.SetCrudManualInterface(grpc_template_decoration.Crud_GRPC{}) | ||||
| 	crud_starter_u_link_store.SetCrudManualInterface(grpc_u_link_store.Crud_GRPC{}) | ||||
| 	crud_starter_w_log.SetCrudManualInterface(grpc_w_log.Crud_GRPC{}) | ||||
| 	crud_starter_w_log_message_del.SetCrudManualInterface(grpc_w_log_message_del.Crud_GRPC{}) | ||||
| 	crud_starter_w_options.SetCrudManualInterface(grpc_w_options.Crud_GRPC{}) | ||||
| } | ||||
							
								
								
									
										10
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								go.mod
									
									
									
									
									
								
							| @@ -13,7 +13,7 @@ require ( | ||||
| 	github.com/ompluscator/dynamic-struct v1.4.0 | ||||
| 	github.com/otiai10/copy v1.14.0 | ||||
| 	github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e | ||||
| 	golang.org/x/tools v0.19.0 | ||||
| 	golang.org/x/tools v0.20.0 | ||||
| 	gorm.io/gorm v1.25.9 | ||||
| ) | ||||
|  | ||||
| @@ -25,10 +25,10 @@ require ( | ||||
| 	github.com/jackc/puddle/v2 v2.2.1 // indirect | ||||
| 	github.com/jinzhu/now v1.1.5 // indirect | ||||
| 	github.com/joho/godotenv v1.5.1 // indirect | ||||
| 	golang.org/x/crypto v0.21.0 // indirect | ||||
| 	golang.org/x/mod v0.16.0 // indirect | ||||
| 	golang.org/x/sync v0.6.0 // indirect | ||||
| 	golang.org/x/sys v0.18.0 // indirect | ||||
| 	golang.org/x/crypto v0.22.0 // indirect | ||||
| 	golang.org/x/mod v0.17.0 // indirect | ||||
| 	golang.org/x/sync v0.7.0 // indirect | ||||
| 	golang.org/x/sys v0.19.0 // indirect | ||||
| 	golang.org/x/text v0.14.0 // indirect | ||||
| 	gorm.io/driver/postgres v1.5.7 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										22
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								go.sum
									
									
									
									
									
								
							| @@ -135,15 +135,15 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y | ||||
| golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= | ||||
| golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= | ||||
| golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= | ||||
| golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= | ||||
| golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= | ||||
| golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= | ||||
| golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= | ||||
| golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= | ||||
| golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= | ||||
| golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= | ||||
| golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= | ||||
| golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= | ||||
| golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= | ||||
| golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= | ||||
| golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= | ||||
| golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= | ||||
| golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||||
| golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| @@ -162,7 +162,7 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= | ||||
| golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= | ||||
| golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= | ||||
| golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= | ||||
| golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= | ||||
| golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= | ||||
| golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| @@ -170,8 +170,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ | ||||
| golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= | ||||
| golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= | ||||
| golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= | ||||
| golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= | ||||
| golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| @@ -197,8 +197,8 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||||
| golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= | ||||
| golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||||
| golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= | ||||
| golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||||
| golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||||
| golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||
| golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= | ||||
| @@ -221,8 +221,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E | ||||
| golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= | ||||
| golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= | ||||
| golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= | ||||
| golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= | ||||
| golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= | ||||
| golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= | ||||
| golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= | ||||
| golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
| golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | ||||
|   | ||||
| @@ -582,19 +582,45 @@ func AddImportTime(TextModel string) string { | ||||
| 	Otvet := TextModel | ||||
|  | ||||
| 	//если уже есть импорт | ||||
| 	pos1 := strings.Index(Otvet, `"time"`) | ||||
| 	RepositoryURL := `"time"` | ||||
| 	pos1 := strings.Index(Otvet, RepositoryURL) | ||||
| 	if pos1 >= 0 { | ||||
| 		return Otvet | ||||
| 	} | ||||
|  | ||||
| 	// | ||||
| 	pos1 = strings.Index(Otvet, "import (") | ||||
| 	TextImport := "import (" | ||||
| 	pos1 = strings.Index(Otvet, TextImport) | ||||
| 	if pos1 < 0 { | ||||
| 		log.Error("not found word: import (") | ||||
| 		log.Error("not found word: ", TextImport) | ||||
| 		return TextModel | ||||
| 	} | ||||
|  | ||||
| 	Otvet = Otvet[:pos1+8] + "\n\t" + `"time"` + Otvet[pos1+8:] | ||||
| 	Otvet = Otvet[:pos1+len(TextImport)] + "\n\t" + RepositoryURL + Otvet[pos1+len(TextImport):] | ||||
|  | ||||
| 	return Otvet | ||||
| } | ||||
|  | ||||
| // AddImportTime - добавляет покет в секцию Import, если его там нет | ||||
| func AddImportUUID(TextModel string) string { | ||||
| 	Otvet := TextModel | ||||
|  | ||||
| 	//если уже есть импорт | ||||
| 	RepositoryURL := `"github.com/google/uuid"` | ||||
| 	pos1 := strings.Index(Otvet, RepositoryURL) | ||||
| 	if pos1 >= 0 { | ||||
| 		return Otvet | ||||
| 	} | ||||
|  | ||||
| 	// | ||||
| 	TextImport := "import (" | ||||
| 	pos1 = strings.Index(Otvet, TextImport) | ||||
| 	if pos1 < 0 { | ||||
| 		log.Error("not found word: ", TextImport) | ||||
| 		return TextModel | ||||
| 	} | ||||
|  | ||||
| 	Otvet = Otvet[:pos1+len(TextImport)] + "\n\t" + RepositoryURL + Otvet[pos1+len(TextImport):] | ||||
|  | ||||
| 	return Otvet | ||||
| } | ||||
| @@ -678,6 +704,20 @@ func CheckAndAddImportTime_FromText(Text string) string { | ||||
| 	return Otvet | ||||
| } | ||||
|  | ||||
| // CheckAndAddImportUUID_FromText - добавляет пакет "uuid" в секцию Import, если его там нет | ||||
| func CheckAndAddImportUUID_FromText(Text string) string { | ||||
| 	Otvet := Text | ||||
|  | ||||
| 	pos1 := strings.Index(Text, " uuid.") | ||||
| 	if pos1 < 0 { | ||||
| 		return Otvet | ||||
| 	} | ||||
|  | ||||
| 	Otvet = AddImportUUID(Otvet) | ||||
|  | ||||
| 	return Otvet | ||||
| } | ||||
|  | ||||
| // CheckAndAddImportTimestamp_FromText - добавляет пакет "time" в секцию Import, если его там нет | ||||
| func CheckAndAddImportTimestamp_FromText(Text string) string { | ||||
| 	Otvet := Text | ||||
|   | ||||
| @@ -92,6 +92,7 @@ func CreateFilesTable_struct(Table1 *types.Table, DirTemplatesTable, DirReadyTab | ||||
| 	TextModel = DeleteFuncFind_byExtID(TextModel, ModelName, Table1) | ||||
|  | ||||
| 	TextModel = create_files.CheckAndAddImportTime_FromText(TextModel) | ||||
| 	TextModel = create_files.CheckAndAddImportUUID_FromText(TextModel) | ||||
| 	TextModel = create_files.DeleteImportModel(TextModel) | ||||
|  | ||||
| 	//замена импортов на новые URL | ||||
|   | ||||
| @@ -346,8 +346,8 @@ func FillIDMinimum(MapTable map[string]*types.Table) { | ||||
| 				WHERE  | ||||
| 					"` + NameID + `" <> ` + DefaultValueSQL | ||||
| 		} else { | ||||
| 			TextSQL = `SELECT "` + NameID + `" as id_minimum FROM "` + Schema + `"."` + TableName + ` | ||||
| 				" WHERE "` + NameID + `" is not null  | ||||
| 			TextSQL = `SELECT "` + NameID + `" as id_minimum FROM "` + Schema + `"."` + TableName + `" | ||||
| 				WHERE "` + NameID + `" is not null  | ||||
| 				ORDER BY ` + NameID + ` | ||||
| 				LIMIT 1` | ||||
| 		} | ||||
|   | ||||
							
								
								
									
										42
									
								
								vendor/golang.org/x/sync/semaphore/semaphore.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								vendor/golang.org/x/sync/semaphore/semaphore.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -35,11 +35,25 @@ type Weighted struct { | ||||
| // Acquire acquires the semaphore with a weight of n, blocking until resources | ||||
| // are available or ctx is done. On success, returns nil. On failure, returns | ||||
| // ctx.Err() and leaves the semaphore unchanged. | ||||
| // | ||||
| // If ctx is already done, Acquire may still succeed without blocking. | ||||
| func (s *Weighted) Acquire(ctx context.Context, n int64) error { | ||||
| 	done := ctx.Done() | ||||
|  | ||||
| 	s.mu.Lock() | ||||
| 	select { | ||||
| 	case <-done: | ||||
| 		// ctx becoming done has "happened before" acquiring the semaphore, | ||||
| 		// whether it became done before the call began or while we were | ||||
| 		// waiting for the mutex. We prefer to fail even if we could acquire | ||||
| 		// the mutex without blocking. | ||||
| 		s.mu.Unlock() | ||||
| 		return ctx.Err() | ||||
| 	default: | ||||
| 	} | ||||
| 	if s.size-s.cur >= n && s.waiters.Len() == 0 { | ||||
| 		// Since we hold s.mu and haven't synchronized since checking done, if | ||||
| 		// ctx becomes done before we return here, it becoming done must have | ||||
| 		// "happened concurrently" with this call - it cannot "happen before" | ||||
| 		// we return in this branch. So, we're ok to always acquire here. | ||||
| 		s.cur += n | ||||
| 		s.mu.Unlock() | ||||
| 		return nil | ||||
| @@ -48,7 +62,7 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { | ||||
| 	if n > s.size { | ||||
| 		// Don't make other Acquire calls block on one that's doomed to fail. | ||||
| 		s.mu.Unlock() | ||||
| 		<-ctx.Done() | ||||
| 		<-done | ||||
| 		return ctx.Err() | ||||
| 	} | ||||
|  | ||||
| @@ -58,14 +72,14 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { | ||||
| 	s.mu.Unlock() | ||||
|  | ||||
| 	select { | ||||
| 	case <-ctx.Done(): | ||||
| 		err := ctx.Err() | ||||
| 	case <-done: | ||||
| 		s.mu.Lock() | ||||
| 		select { | ||||
| 		case <-ready: | ||||
| 			// Acquired the semaphore after we were canceled.  Rather than trying to | ||||
| 			// fix up the queue, just pretend we didn't notice the cancelation. | ||||
| 			err = nil | ||||
| 			// Acquired the semaphore after we were canceled. | ||||
| 			// Pretend we didn't and put the tokens back. | ||||
| 			s.cur -= n | ||||
| 			s.notifyWaiters() | ||||
| 		default: | ||||
| 			isFront := s.waiters.Front() == elem | ||||
| 			s.waiters.Remove(elem) | ||||
| @@ -75,9 +89,19 @@ func (s *Weighted) Acquire(ctx context.Context, n int64) error { | ||||
| 			} | ||||
| 		} | ||||
| 		s.mu.Unlock() | ||||
| 		return err | ||||
| 		return ctx.Err() | ||||
|  | ||||
| 	case <-ready: | ||||
| 		// Acquired the semaphore. Check that ctx isn't already done. | ||||
| 		// We check the done channel instead of calling ctx.Err because we | ||||
| 		// already have the channel, and ctx.Err is O(n) with the nesting | ||||
| 		// depth of ctx. | ||||
| 		select { | ||||
| 		case <-done: | ||||
| 			s.Release(n) | ||||
| 			return ctx.Err() | ||||
| 		default: | ||||
| 		} | ||||
| 		return nil | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/golang.org/x/sys/unix/mmap_nomremap.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/golang.org/x/sys/unix/mmap_nomremap.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,7 +2,7 @@ | ||||
| // Use of this source code is governed by a BSD-style | ||||
| // license that can be found in the LICENSE file. | ||||
|  | ||||
| //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris | ||||
| //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos | ||||
|  | ||||
| package unix | ||||
|  | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1520,6 +1520,14 @@ func (m *mmapper) Munmap(data []byte) (err error) { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { | ||||
|         return mapper.Mmap(fd, offset, length, prot, flags) | ||||
| } | ||||
|  | ||||
| func Munmap(b []byte) (err error) { | ||||
|         return mapper.Munmap(b) | ||||
| } | ||||
|  | ||||
| func Read(fd int, p []byte) (n int, err error) { | ||||
| 	n, err = read(fd, p) | ||||
| 	if raceenabled { | ||||
|   | ||||
							
								
								
									
										82
									
								
								vendor/golang.org/x/sys/windows/syscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										82
									
								
								vendor/golang.org/x/sys/windows/syscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -165,6 +165,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { | ||||
| //sys	CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW | ||||
| //sys	CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error)  [failretval==InvalidHandle] = CreateNamedPipeW | ||||
| //sys	ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) | ||||
| //sys	DisconnectNamedPipe(pipe Handle) (err error) | ||||
| //sys	GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) | ||||
| //sys	GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW | ||||
| //sys	SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState | ||||
| @@ -348,8 +349,19 @@ func NewCallbackCDecl(fn interface{}) uintptr { | ||||
| //sys	SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost | ||||
| //sys	GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) | ||||
| //sys	SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) | ||||
| //sys	ClearCommBreak(handle Handle) (err error) | ||||
| //sys	ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) | ||||
| //sys	EscapeCommFunction(handle Handle, dwFunc uint32) (err error) | ||||
| //sys	GetCommState(handle Handle, lpDCB *DCB) (err error) | ||||
| //sys	GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) | ||||
| //sys	GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) | ||||
| //sys	PurgeComm(handle Handle, dwFlags uint32) (err error) | ||||
| //sys	SetCommBreak(handle Handle) (err error) | ||||
| //sys	SetCommMask(handle Handle, dwEvtMask uint32) (err error) | ||||
| //sys	SetCommState(handle Handle, lpDCB *DCB) (err error) | ||||
| //sys	SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) | ||||
| //sys	SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) | ||||
| //sys	WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) | ||||
| //sys	GetActiveProcessorCount(groupNumber uint16) (ret uint32) | ||||
| //sys	GetMaximumProcessorCount(groupNumber uint16) (ret uint32) | ||||
| //sys	EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) = user32.EnumWindows | ||||
| @@ -1834,3 +1846,73 @@ func ResizePseudoConsole(pconsole Handle, size Coord) error { | ||||
| 	// accept arguments that can be casted to uintptr, and Coord can't. | ||||
| 	return resizePseudoConsole(pconsole, *((*uint32)(unsafe.Pointer(&size)))) | ||||
| } | ||||
|  | ||||
| // DCB constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-dcb. | ||||
| const ( | ||||
| 	CBR_110    = 110 | ||||
| 	CBR_300    = 300 | ||||
| 	CBR_600    = 600 | ||||
| 	CBR_1200   = 1200 | ||||
| 	CBR_2400   = 2400 | ||||
| 	CBR_4800   = 4800 | ||||
| 	CBR_9600   = 9600 | ||||
| 	CBR_14400  = 14400 | ||||
| 	CBR_19200  = 19200 | ||||
| 	CBR_38400  = 38400 | ||||
| 	CBR_57600  = 57600 | ||||
| 	CBR_115200 = 115200 | ||||
| 	CBR_128000 = 128000 | ||||
| 	CBR_256000 = 256000 | ||||
|  | ||||
| 	DTR_CONTROL_DISABLE   = 0x00000000 | ||||
| 	DTR_CONTROL_ENABLE    = 0x00000010 | ||||
| 	DTR_CONTROL_HANDSHAKE = 0x00000020 | ||||
|  | ||||
| 	RTS_CONTROL_DISABLE   = 0x00000000 | ||||
| 	RTS_CONTROL_ENABLE    = 0x00001000 | ||||
| 	RTS_CONTROL_HANDSHAKE = 0x00002000 | ||||
| 	RTS_CONTROL_TOGGLE    = 0x00003000 | ||||
|  | ||||
| 	NOPARITY    = 0 | ||||
| 	ODDPARITY   = 1 | ||||
| 	EVENPARITY  = 2 | ||||
| 	MARKPARITY  = 3 | ||||
| 	SPACEPARITY = 4 | ||||
|  | ||||
| 	ONESTOPBIT   = 0 | ||||
| 	ONE5STOPBITS = 1 | ||||
| 	TWOSTOPBITS  = 2 | ||||
| ) | ||||
|  | ||||
| // EscapeCommFunction constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-escapecommfunction. | ||||
| const ( | ||||
| 	SETXOFF  = 1 | ||||
| 	SETXON   = 2 | ||||
| 	SETRTS   = 3 | ||||
| 	CLRRTS   = 4 | ||||
| 	SETDTR   = 5 | ||||
| 	CLRDTR   = 6 | ||||
| 	SETBREAK = 8 | ||||
| 	CLRBREAK = 9 | ||||
| ) | ||||
|  | ||||
| // PurgeComm constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-purgecomm. | ||||
| const ( | ||||
| 	PURGE_TXABORT = 0x0001 | ||||
| 	PURGE_RXABORT = 0x0002 | ||||
| 	PURGE_TXCLEAR = 0x0004 | ||||
| 	PURGE_RXCLEAR = 0x0008 | ||||
| ) | ||||
|  | ||||
| // SetCommMask constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setcommmask. | ||||
| const ( | ||||
| 	EV_RXCHAR  = 0x0001 | ||||
| 	EV_RXFLAG  = 0x0002 | ||||
| 	EV_TXEMPTY = 0x0004 | ||||
| 	EV_CTS     = 0x0008 | ||||
| 	EV_DSR     = 0x0010 | ||||
| 	EV_RLSD    = 0x0020 | ||||
| 	EV_BREAK   = 0x0040 | ||||
| 	EV_ERR     = 0x0080 | ||||
| 	EV_RING    = 0x0100 | ||||
| ) | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/golang.org/x/sys/windows/types_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/golang.org/x/sys/windows/types_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -3380,3 +3380,27 @@ type BLOB struct { | ||||
| 	Size     uint32 | ||||
| 	BlobData *byte | ||||
| } | ||||
|  | ||||
| type ComStat struct { | ||||
| 	Flags    uint32 | ||||
| 	CBInQue  uint32 | ||||
| 	CBOutQue uint32 | ||||
| } | ||||
|  | ||||
| type DCB struct { | ||||
| 	DCBlength  uint32 | ||||
| 	BaudRate   uint32 | ||||
| 	Flags      uint32 | ||||
| 	wReserved  uint16 | ||||
| 	XonLim     uint16 | ||||
| 	XoffLim    uint16 | ||||
| 	ByteSize   uint8 | ||||
| 	Parity     uint8 | ||||
| 	StopBits   uint8 | ||||
| 	XonChar    byte | ||||
| 	XoffChar   byte | ||||
| 	ErrorChar  byte | ||||
| 	EofChar    byte | ||||
| 	EvtChar    byte | ||||
| 	wReserved1 uint16 | ||||
| } | ||||
|   | ||||
							
								
								
									
										126
									
								
								vendor/golang.org/x/sys/windows/zsyscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										126
									
								
								vendor/golang.org/x/sys/windows/zsyscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -188,6 +188,8 @@ var ( | ||||
| 	procAssignProcessToJobObject                             = modkernel32.NewProc("AssignProcessToJobObject") | ||||
| 	procCancelIo                                             = modkernel32.NewProc("CancelIo") | ||||
| 	procCancelIoEx                                           = modkernel32.NewProc("CancelIoEx") | ||||
| 	procClearCommBreak                                       = modkernel32.NewProc("ClearCommBreak") | ||||
| 	procClearCommError                                       = modkernel32.NewProc("ClearCommError") | ||||
| 	procCloseHandle                                          = modkernel32.NewProc("CloseHandle") | ||||
| 	procClosePseudoConsole                                   = modkernel32.NewProc("ClosePseudoConsole") | ||||
| 	procConnectNamedPipe                                     = modkernel32.NewProc("ConnectNamedPipe") | ||||
| @@ -212,7 +214,9 @@ var ( | ||||
| 	procDeleteProcThreadAttributeList                        = modkernel32.NewProc("DeleteProcThreadAttributeList") | ||||
| 	procDeleteVolumeMountPointW                              = modkernel32.NewProc("DeleteVolumeMountPointW") | ||||
| 	procDeviceIoControl                                      = modkernel32.NewProc("DeviceIoControl") | ||||
| 	procDisconnectNamedPipe                                  = modkernel32.NewProc("DisconnectNamedPipe") | ||||
| 	procDuplicateHandle                                      = modkernel32.NewProc("DuplicateHandle") | ||||
| 	procEscapeCommFunction                                   = modkernel32.NewProc("EscapeCommFunction") | ||||
| 	procExitProcess                                          = modkernel32.NewProc("ExitProcess") | ||||
| 	procExpandEnvironmentStringsW                            = modkernel32.NewProc("ExpandEnvironmentStringsW") | ||||
| 	procFindClose                                            = modkernel32.NewProc("FindClose") | ||||
| @@ -236,6 +240,8 @@ var ( | ||||
| 	procGenerateConsoleCtrlEvent                             = modkernel32.NewProc("GenerateConsoleCtrlEvent") | ||||
| 	procGetACP                                               = modkernel32.NewProc("GetACP") | ||||
| 	procGetActiveProcessorCount                              = modkernel32.NewProc("GetActiveProcessorCount") | ||||
| 	procGetCommModemStatus                                   = modkernel32.NewProc("GetCommModemStatus") | ||||
| 	procGetCommState                                         = modkernel32.NewProc("GetCommState") | ||||
| 	procGetCommTimeouts                                      = modkernel32.NewProc("GetCommTimeouts") | ||||
| 	procGetCommandLineW                                      = modkernel32.NewProc("GetCommandLineW") | ||||
| 	procGetComputerNameExW                                   = modkernel32.NewProc("GetComputerNameExW") | ||||
| @@ -322,6 +328,7 @@ var ( | ||||
| 	procProcess32NextW                                       = modkernel32.NewProc("Process32NextW") | ||||
| 	procProcessIdToSessionId                                 = modkernel32.NewProc("ProcessIdToSessionId") | ||||
| 	procPulseEvent                                           = modkernel32.NewProc("PulseEvent") | ||||
| 	procPurgeComm                                            = modkernel32.NewProc("PurgeComm") | ||||
| 	procQueryDosDeviceW                                      = modkernel32.NewProc("QueryDosDeviceW") | ||||
| 	procQueryFullProcessImageNameW                           = modkernel32.NewProc("QueryFullProcessImageNameW") | ||||
| 	procQueryInformationJobObject                            = modkernel32.NewProc("QueryInformationJobObject") | ||||
| @@ -335,6 +342,9 @@ var ( | ||||
| 	procResetEvent                                           = modkernel32.NewProc("ResetEvent") | ||||
| 	procResizePseudoConsole                                  = modkernel32.NewProc("ResizePseudoConsole") | ||||
| 	procResumeThread                                         = modkernel32.NewProc("ResumeThread") | ||||
| 	procSetCommBreak                                         = modkernel32.NewProc("SetCommBreak") | ||||
| 	procSetCommMask                                          = modkernel32.NewProc("SetCommMask") | ||||
| 	procSetCommState                                         = modkernel32.NewProc("SetCommState") | ||||
| 	procSetCommTimeouts                                      = modkernel32.NewProc("SetCommTimeouts") | ||||
| 	procSetConsoleCursorPosition                             = modkernel32.NewProc("SetConsoleCursorPosition") | ||||
| 	procSetConsoleMode                                       = modkernel32.NewProc("SetConsoleMode") | ||||
| @@ -342,7 +352,6 @@ var ( | ||||
| 	procSetDefaultDllDirectories                             = modkernel32.NewProc("SetDefaultDllDirectories") | ||||
| 	procSetDllDirectoryW                                     = modkernel32.NewProc("SetDllDirectoryW") | ||||
| 	procSetEndOfFile                                         = modkernel32.NewProc("SetEndOfFile") | ||||
| 	procSetFileValidData                                     = modkernel32.NewProc("SetFileValidData") | ||||
| 	procSetEnvironmentVariableW                              = modkernel32.NewProc("SetEnvironmentVariableW") | ||||
| 	procSetErrorMode                                         = modkernel32.NewProc("SetErrorMode") | ||||
| 	procSetEvent                                             = modkernel32.NewProc("SetEvent") | ||||
| @@ -351,6 +360,7 @@ var ( | ||||
| 	procSetFileInformationByHandle                           = modkernel32.NewProc("SetFileInformationByHandle") | ||||
| 	procSetFilePointer                                       = modkernel32.NewProc("SetFilePointer") | ||||
| 	procSetFileTime                                          = modkernel32.NewProc("SetFileTime") | ||||
| 	procSetFileValidData                                     = modkernel32.NewProc("SetFileValidData") | ||||
| 	procSetHandleInformation                                 = modkernel32.NewProc("SetHandleInformation") | ||||
| 	procSetInformationJobObject                              = modkernel32.NewProc("SetInformationJobObject") | ||||
| 	procSetNamedPipeHandleState                              = modkernel32.NewProc("SetNamedPipeHandleState") | ||||
| @@ -361,6 +371,7 @@ var ( | ||||
| 	procSetStdHandle                                         = modkernel32.NewProc("SetStdHandle") | ||||
| 	procSetVolumeLabelW                                      = modkernel32.NewProc("SetVolumeLabelW") | ||||
| 	procSetVolumeMountPointW                                 = modkernel32.NewProc("SetVolumeMountPointW") | ||||
| 	procSetupComm                                            = modkernel32.NewProc("SetupComm") | ||||
| 	procSizeofResource                                       = modkernel32.NewProc("SizeofResource") | ||||
| 	procSleepEx                                              = modkernel32.NewProc("SleepEx") | ||||
| 	procTerminateJobObject                                   = modkernel32.NewProc("TerminateJobObject") | ||||
| @@ -379,6 +390,7 @@ var ( | ||||
| 	procVirtualQueryEx                                       = modkernel32.NewProc("VirtualQueryEx") | ||||
| 	procVirtualUnlock                                        = modkernel32.NewProc("VirtualUnlock") | ||||
| 	procWTSGetActiveConsoleSessionId                         = modkernel32.NewProc("WTSGetActiveConsoleSessionId") | ||||
| 	procWaitCommEvent                                        = modkernel32.NewProc("WaitCommEvent") | ||||
| 	procWaitForMultipleObjects                               = modkernel32.NewProc("WaitForMultipleObjects") | ||||
| 	procWaitForSingleObject                                  = modkernel32.NewProc("WaitForSingleObject") | ||||
| 	procWriteConsoleW                                        = modkernel32.NewProc("WriteConsoleW") | ||||
| @@ -1641,6 +1653,22 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func ClearCommBreak(handle Handle) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procClearCommBreak.Addr(), 1, uintptr(handle), 0, 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procClearCommError.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func CloseHandle(handle Handle) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0) | ||||
| 	if r1 == 0 { | ||||
| @@ -1845,6 +1873,14 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func DisconnectNamedPipe(pipe Handle) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procDisconnectNamedPipe.Addr(), 1, uintptr(pipe), 0, 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error) { | ||||
| 	var _p0 uint32 | ||||
| 	if bInheritHandle { | ||||
| @@ -1857,6 +1893,14 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procEscapeCommFunction.Addr(), 2, uintptr(handle), uintptr(dwFunc), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func ExitProcess(exitcode uint32) { | ||||
| 	syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0) | ||||
| 	return | ||||
| @@ -2058,6 +2102,22 @@ func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procGetCommModemStatus.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func GetCommState(handle Handle, lpDCB *DCB) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procGetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) | ||||
| 	if r1 == 0 { | ||||
| @@ -2810,6 +2870,14 @@ func PulseEvent(event Handle) (err error) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func PurgeComm(handle Handle, dwFlags uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procPurgeComm.Addr(), 2, uintptr(handle), uintptr(dwFlags), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { | ||||
| 	r0, _, e1 := syscall.Syscall(procQueryDosDeviceW.Addr(), 3, uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) | ||||
| 	n = uint32(r0) | ||||
| @@ -2924,6 +2992,30 @@ func ResumeThread(thread Handle) (ret uint32, err error) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetCommBreak(handle Handle) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetCommBreak.Addr(), 1, uintptr(handle), 0, 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetCommMask.Addr(), 2, uintptr(handle), uintptr(dwEvtMask), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetCommState(handle Handle, lpDCB *DCB) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) | ||||
| 	if r1 == 0 { | ||||
| @@ -2989,14 +3081,6 @@ func SetEndOfFile(handle Handle) (err error) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetFileValidData(handle Handle, validDataLength int64) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) | ||||
| 	if r1 == 0 { | ||||
| @@ -3060,6 +3144,14 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetFileValidData(handle Handle, validDataLength int64) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags)) | ||||
| 	if r1 == 0 { | ||||
| @@ -3145,6 +3237,14 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procSetupComm.Addr(), 3, uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { | ||||
| 	r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) | ||||
| 	size = uint32(r0) | ||||
| @@ -3291,6 +3391,14 @@ func WTSGetActiveConsoleSessionId() (sessionID uint32) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { | ||||
| 	r1, _, e1 := syscall.Syscall(procWaitCommEvent.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) | ||||
| 	if r1 == 0 { | ||||
| 		err = errnoErr(e1) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMilliseconds uint32) (event uint32, err error) { | ||||
| 	var _p0 uint32 | ||||
| 	if waitAll { | ||||
|   | ||||
							
								
								
									
										3
									
								
								vendor/golang.org/x/tools/internal/gocommand/invoke.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/golang.org/x/tools/internal/gocommand/invoke.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -158,12 +158,15 @@ type Invocation struct { | ||||
| 	BuildFlags []string | ||||
|  | ||||
| 	// If ModFlag is set, the go command is invoked with -mod=ModFlag. | ||||
| 	// TODO(rfindley): remove, in favor of Args. | ||||
| 	ModFlag string | ||||
|  | ||||
| 	// If ModFile is set, the go command is invoked with -modfile=ModFile. | ||||
| 	// TODO(rfindley): remove, in favor of Args. | ||||
| 	ModFile string | ||||
|  | ||||
| 	// If Overlay is set, the go command is invoked with -overlay=Overlay. | ||||
| 	// TODO(rfindley): remove, in favor of Args. | ||||
| 	Overlay string | ||||
|  | ||||
| 	// If CleanEnv is set, the invocation will run only with the environment | ||||
|   | ||||
							
								
								
									
										89
									
								
								vendor/golang.org/x/tools/internal/imports/fix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										89
									
								
								vendor/golang.org/x/tools/internal/imports/fix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -31,6 +31,7 @@ import ( | ||||
| 	"golang.org/x/tools/internal/event" | ||||
| 	"golang.org/x/tools/internal/gocommand" | ||||
| 	"golang.org/x/tools/internal/gopathwalk" | ||||
| 	"golang.org/x/tools/internal/stdlib" | ||||
| ) | ||||
|  | ||||
| // importToGroup is a list of functions which map from an import path to | ||||
| @@ -511,9 +512,9 @@ func (p *pass) assumeSiblingImportsValid() { | ||||
| 		} | ||||
| 		for left, rights := range refs { | ||||
| 			if imp, ok := importsByName[left]; ok { | ||||
| 				if m, ok := stdlib[imp.ImportPath]; ok { | ||||
| 				if m, ok := stdlib.PackageSymbols[imp.ImportPath]; ok { | ||||
| 					// We have the stdlib in memory; no need to guess. | ||||
| 					rights = copyExports(m) | ||||
| 					rights = symbolNameSet(m) | ||||
| 				} | ||||
| 				p.addCandidate(imp, &packageInfo{ | ||||
| 					// no name; we already know it. | ||||
| @@ -641,7 +642,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena | ||||
| 	dupCheck := map[string]struct{}{} | ||||
|  | ||||
| 	// Start off with the standard library. | ||||
| 	for importPath, exports := range stdlib { | ||||
| 	for importPath, symbols := range stdlib.PackageSymbols { | ||||
| 		p := &pkg{ | ||||
| 			dir:             filepath.Join(goenv["GOROOT"], "src", importPath), | ||||
| 			importPathShort: importPath, | ||||
| @@ -650,6 +651,13 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena | ||||
| 		} | ||||
| 		dupCheck[importPath] = struct{}{} | ||||
| 		if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { | ||||
| 			var exports []stdlib.Symbol | ||||
| 			for _, sym := range symbols { | ||||
| 				switch sym.Kind { | ||||
| 				case stdlib.Func, stdlib.Type, stdlib.Var, stdlib.Const: | ||||
| 					exports = append(exports, sym) | ||||
| 				} | ||||
| 			} | ||||
| 			wrappedCallback.exportsLoaded(p, exports) | ||||
| 		} | ||||
| 	} | ||||
| @@ -670,7 +678,7 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena | ||||
| 			dupCheck[pkg.importPathShort] = struct{}{} | ||||
| 			return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) | ||||
| 		}, | ||||
| 		exportsLoaded: func(pkg *pkg, exports []string) { | ||||
| 		exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { | ||||
| 			// If we're an x_test, load the package under test's test variant. | ||||
| 			if strings.HasSuffix(filePkg, "_test") && pkg.dir == filepath.Dir(filename) { | ||||
| 				var err error | ||||
| @@ -795,7 +803,7 @@ func GetImportPaths(ctx context.Context, wrapped func(ImportFix), searchPrefix, | ||||
| // A PackageExport is a package and its exports. | ||||
| type PackageExport struct { | ||||
| 	Fix     *ImportFix | ||||
| 	Exports []string | ||||
| 	Exports []stdlib.Symbol | ||||
| } | ||||
|  | ||||
| // GetPackageExports returns all known packages with name pkg and their exports. | ||||
| @@ -810,8 +818,8 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP | ||||
| 		packageNameLoaded: func(pkg *pkg) bool { | ||||
| 			return pkg.packageName == searchPkg | ||||
| 		}, | ||||
| 		exportsLoaded: func(pkg *pkg, exports []string) { | ||||
| 			sort.Strings(exports) | ||||
| 		exportsLoaded: func(pkg *pkg, exports []stdlib.Symbol) { | ||||
| 			sortSymbols(exports) | ||||
| 			wrapped(PackageExport{ | ||||
| 				Fix: &ImportFix{ | ||||
| 					StmtInfo: ImportInfo{ | ||||
| @@ -988,8 +996,10 @@ func (e *ProcessEnv) GetResolver() (Resolver, error) { | ||||
| 		// already know the view type. | ||||
| 		if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { | ||||
| 			e.resolver = newGopathResolver(e) | ||||
| 		} else if r, err := newModuleResolver(e, e.ModCache); err != nil { | ||||
| 			e.resolverErr = err | ||||
| 		} else { | ||||
| 			e.resolver, e.resolverErr = newModuleResolver(e, e.ModCache) | ||||
| 			e.resolver = Resolver(r) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @@ -1054,7 +1064,7 @@ func addStdlibCandidates(pass *pass, refs references) error { | ||||
| 		if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir { | ||||
| 			return | ||||
| 		} | ||||
| 		exports := copyExports(stdlib[pkg]) | ||||
| 		exports := symbolNameSet(stdlib.PackageSymbols[pkg]) | ||||
| 		pass.addCandidate( | ||||
| 			&ImportInfo{ImportPath: pkg}, | ||||
| 			&packageInfo{name: path.Base(pkg), exports: exports}) | ||||
| @@ -1066,7 +1076,7 @@ func addStdlibCandidates(pass *pass, refs references) error { | ||||
| 			add("math/rand") | ||||
| 			continue | ||||
| 		} | ||||
| 		for importPath := range stdlib { | ||||
| 		for importPath := range stdlib.PackageSymbols { | ||||
| 			if path.Base(importPath) == left { | ||||
| 				add(importPath) | ||||
| 			} | ||||
| @@ -1085,7 +1095,7 @@ type Resolver interface { | ||||
|  | ||||
| 	// loadExports returns the set of exported symbols in the package at dir. | ||||
| 	// loadExports may be called concurrently. | ||||
| 	loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) | ||||
| 	loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) | ||||
|  | ||||
| 	// scoreImportPath returns the relevance for an import path. | ||||
| 	scoreImportPath(ctx context.Context, path string) float64 | ||||
| @@ -1114,7 +1124,7 @@ type scanCallback struct { | ||||
| 	// If it returns true, the package's exports will be loaded. | ||||
| 	packageNameLoaded func(pkg *pkg) bool | ||||
| 	// exportsLoaded is called when a package's exports have been loaded. | ||||
| 	exportsLoaded func(pkg *pkg, exports []string) | ||||
| 	exportsLoaded func(pkg *pkg, exports []stdlib.Symbol) | ||||
| } | ||||
|  | ||||
| func addExternalCandidates(ctx context.Context, pass *pass, refs references, filename string) error { | ||||
| @@ -1295,7 +1305,7 @@ func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) ( | ||||
| // importPathToName finds out the actual package name, as declared in its .go files. | ||||
| func importPathToName(bctx *build.Context, importPath, srcDir string) string { | ||||
| 	// Fast path for standard library without going to disk. | ||||
| 	if _, ok := stdlib[importPath]; ok { | ||||
| 	if stdlib.HasPackage(importPath) { | ||||
| 		return path.Base(importPath) // stdlib packages always match their paths. | ||||
| 	} | ||||
|  | ||||
| @@ -1493,7 +1503,7 @@ func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error | ||||
| } | ||||
|  | ||||
| func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { | ||||
| 	if _, ok := stdlib[path]; ok { | ||||
| 	if stdlib.HasPackage(path) { | ||||
| 		return MaxRelevance | ||||
| 	} | ||||
| 	return MaxRelevance - 1 | ||||
| @@ -1510,7 +1520,7 @@ func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) [] | ||||
| 	return result | ||||
| } | ||||
|  | ||||
| func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { | ||||
| func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { | ||||
| 	if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { | ||||
| 		return r.cache.CacheExports(ctx, r.env, info) | ||||
| 	} | ||||
| @@ -1530,7 +1540,7 @@ func VendorlessPath(ipath string) string { | ||||
| 	return ipath | ||||
| } | ||||
|  | ||||
| func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { | ||||
| func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []stdlib.Symbol, error) { | ||||
| 	// Look for non-test, buildable .go files which could provide exports. | ||||
| 	all, err := os.ReadDir(dir) | ||||
| 	if err != nil { | ||||
| @@ -1554,7 +1564,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl | ||||
| 	} | ||||
|  | ||||
| 	var pkgName string | ||||
| 	var exports []string | ||||
| 	var exports []stdlib.Symbol | ||||
| 	fset := token.NewFileSet() | ||||
| 	for _, fi := range files { | ||||
| 		select { | ||||
| @@ -1581,21 +1591,41 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl | ||||
| 			continue | ||||
| 		} | ||||
| 		pkgName = f.Name.Name | ||||
| 		for name := range f.Scope.Objects { | ||||
| 		for name, obj := range f.Scope.Objects { | ||||
| 			if ast.IsExported(name) { | ||||
| 				exports = append(exports, name) | ||||
| 				var kind stdlib.Kind | ||||
| 				switch obj.Kind { | ||||
| 				case ast.Con: | ||||
| 					kind = stdlib.Const | ||||
| 				case ast.Typ: | ||||
| 					kind = stdlib.Type | ||||
| 				case ast.Var: | ||||
| 					kind = stdlib.Var | ||||
| 				case ast.Fun: | ||||
| 					kind = stdlib.Func | ||||
| 				} | ||||
| 				exports = append(exports, stdlib.Symbol{ | ||||
| 					Name:    name, | ||||
| 					Kind:    kind, | ||||
| 					Version: 0, // unknown; be permissive | ||||
| 				}) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	sortSymbols(exports) | ||||
|  | ||||
| 	if env.Logf != nil { | ||||
| 		sortedExports := append([]string(nil), exports...) | ||||
| 		sort.Strings(sortedExports) | ||||
| 		env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) | ||||
| 		env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, exports) | ||||
| 	} | ||||
| 	return pkgName, exports, nil | ||||
| } | ||||
|  | ||||
| func sortSymbols(syms []stdlib.Symbol) { | ||||
| 	sort.Slice(syms, func(i, j int) bool { | ||||
| 		return syms[i].Name < syms[j].Name | ||||
| 	}) | ||||
| } | ||||
|  | ||||
| // findImport searches for a package with the given symbols. | ||||
| // If no package is found, findImport returns ("", false, nil) | ||||
| func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*pkg, error) { | ||||
| @@ -1662,7 +1692,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa | ||||
|  | ||||
| 				exportsMap := make(map[string]bool, len(exports)) | ||||
| 				for _, sym := range exports { | ||||
| 					exportsMap[sym] = true | ||||
| 					exportsMap[sym.Name] = true | ||||
| 				} | ||||
|  | ||||
| 				// If it doesn't have the right | ||||
| @@ -1820,10 +1850,13 @@ func (fn visitFn) Visit(node ast.Node) ast.Visitor { | ||||
| 	return fn(node) | ||||
| } | ||||
|  | ||||
| func copyExports(pkg []string) map[string]bool { | ||||
| 	m := make(map[string]bool, len(pkg)) | ||||
| 	for _, v := range pkg { | ||||
| 		m[v] = true | ||||
| func symbolNameSet(symbols []stdlib.Symbol) map[string]bool { | ||||
| 	names := make(map[string]bool) | ||||
| 	for _, sym := range symbols { | ||||
| 		switch sym.Kind { | ||||
| 		case stdlib.Const, stdlib.Var, stdlib.Type, stdlib.Func: | ||||
| 			names[sym.Name] = true | ||||
| 		} | ||||
| 	} | ||||
| 	return m | ||||
| 	return names | ||||
| } | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/golang.org/x/tools/internal/imports/imports.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/golang.org/x/tools/internal/imports/imports.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,8 +2,6 @@ | ||||
| // Use of this source code is governed by a BSD-style | ||||
| // license that can be found in the LICENSE file. | ||||
|  | ||||
| //go:generate go run mkstdlib.go | ||||
|  | ||||
| // Package imports implements a Go pretty-printer (like package "go/format") | ||||
| // that also adds or removes import statements as necessary. | ||||
| package imports | ||||
| @@ -109,7 +107,7 @@ func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, e | ||||
| } | ||||
|  | ||||
| // formatFile formats the file syntax tree. | ||||
| // It may mutate the token.FileSet. | ||||
| // It may mutate the token.FileSet and the ast.File. | ||||
| // | ||||
| // If an adjust function is provided, it is called after formatting | ||||
| // with the original source (formatFile's src parameter) and the | ||||
|   | ||||
							
								
								
									
										27
									
								
								vendor/golang.org/x/tools/internal/imports/mod.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								vendor/golang.org/x/tools/internal/imports/mod.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -21,6 +21,7 @@ import ( | ||||
| 	"golang.org/x/tools/internal/event" | ||||
| 	"golang.org/x/tools/internal/gocommand" | ||||
| 	"golang.org/x/tools/internal/gopathwalk" | ||||
| 	"golang.org/x/tools/internal/stdlib" | ||||
| ) | ||||
|  | ||||
| // Notes(rfindley): ModuleResolver appears to be heavily optimized for scanning | ||||
| @@ -313,15 +314,19 @@ func (r *ModuleResolver) ClearForNewScan() Resolver { | ||||
| // TODO(rfindley): move this to a new env.go, consolidating ProcessEnv methods. | ||||
| func (e *ProcessEnv) ClearModuleInfo() { | ||||
| 	if r, ok := e.resolver.(*ModuleResolver); ok { | ||||
| 		resolver, resolverErr := newModuleResolver(e, e.ModCache) | ||||
| 		if resolverErr == nil { | ||||
| 			<-r.scanSema // acquire (guards caches) | ||||
| 			resolver.moduleCacheCache = r.moduleCacheCache | ||||
| 			resolver.otherCache = r.otherCache | ||||
| 			r.scanSema <- struct{}{} // release | ||||
| 		resolver, err := newModuleResolver(e, e.ModCache) | ||||
| 		if err != nil { | ||||
| 			e.resolver = nil | ||||
| 			e.resolverErr = err | ||||
| 			return | ||||
| 		} | ||||
| 		e.resolver = resolver | ||||
| 		e.resolverErr = resolverErr | ||||
|  | ||||
| 		<-r.scanSema // acquire (guards caches) | ||||
| 		resolver.moduleCacheCache = r.moduleCacheCache | ||||
| 		resolver.otherCache = r.otherCache | ||||
| 		r.scanSema <- struct{}{} // release | ||||
|  | ||||
| 		e.UpdateResolver(resolver) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -412,7 +417,7 @@ func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, er | ||||
| 	return r.otherCache.CachePackageName(info) | ||||
| } | ||||
|  | ||||
| func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { | ||||
| func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { | ||||
| 	if info.rootType == gopathwalk.RootModuleCache { | ||||
| 		return r.moduleCacheCache.CacheExports(ctx, env, info) | ||||
| 	} | ||||
| @@ -632,7 +637,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error | ||||
| } | ||||
|  | ||||
| func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { | ||||
| 	if _, ok := stdlib[path]; ok { | ||||
| 	if stdlib.HasPackage(path) { | ||||
| 		return MaxRelevance | ||||
| 	} | ||||
| 	mod, _ := r.findPackage(path) | ||||
| @@ -710,7 +715,7 @@ func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { | ||||
| 	return res, nil | ||||
| } | ||||
|  | ||||
| func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { | ||||
| func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error) { | ||||
| 	if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { | ||||
| 		return r.cacheExports(ctx, r.env, info) | ||||
| 	} | ||||
|   | ||||
							
								
								
									
										5
									
								
								vendor/golang.org/x/tools/internal/imports/mod_cache.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/golang.org/x/tools/internal/imports/mod_cache.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -14,6 +14,7 @@ import ( | ||||
|  | ||||
| 	"golang.org/x/mod/module" | ||||
| 	"golang.org/x/tools/internal/gopathwalk" | ||||
| 	"golang.org/x/tools/internal/stdlib" | ||||
| ) | ||||
|  | ||||
| // To find packages to import, the resolver needs to know about all of | ||||
| @@ -73,7 +74,7 @@ type directoryPackageInfo struct { | ||||
| 	// the default build context GOOS and GOARCH. | ||||
| 	// | ||||
| 	// We can make this explicit, and key exports by GOOS, GOARCH. | ||||
| 	exports []string | ||||
| 	exports []stdlib.Symbol | ||||
| } | ||||
|  | ||||
| // reachedStatus returns true when info has a status at least target and any error associated with | ||||
| @@ -229,7 +230,7 @@ func (d *DirInfoCache) CachePackageName(info directoryPackageInfo) (string, erro | ||||
| 	return info.packageName, info.err | ||||
| } | ||||
|  | ||||
| func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { | ||||
| func (d *DirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []stdlib.Symbol, error) { | ||||
| 	if reached, _ := info.reachedStatus(exportsLoaded); reached { | ||||
| 		return info.packageName, info.exports, info.err | ||||
| 	} | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/golang.org/x/tools/internal/imports/sortimports.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/golang.org/x/tools/internal/imports/sortimports.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -18,7 +18,7 @@ import ( | ||||
| // sortImports sorts runs of consecutive import lines in import blocks in f. | ||||
| // It also removes duplicate imports when it is possible to do so without data loss. | ||||
| // | ||||
| // It may mutate the token.File. | ||||
| // It may mutate the token.File and the ast.File. | ||||
| func sortImports(localPrefix string, tokFile *token.File, f *ast.File) { | ||||
| 	for i, d := range f.Decls { | ||||
| 		d, ok := d.(*ast.GenDecl) | ||||
|   | ||||
							
								
								
									
										11406
									
								
								vendor/golang.org/x/tools/internal/imports/zstdlib.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11406
									
								
								vendor/golang.org/x/tools/internal/imports/zstdlib.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										17320
									
								
								vendor/golang.org/x/tools/internal/stdlib/manifest.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17320
									
								
								vendor/golang.org/x/tools/internal/stdlib/manifest.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										97
									
								
								vendor/golang.org/x/tools/internal/stdlib/stdlib.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								vendor/golang.org/x/tools/internal/stdlib/stdlib.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,97 @@ | ||||
| // Copyright 2022 The Go Authors. All rights reserved. | ||||
| // Use of this source code is governed by a BSD-style | ||||
| // license that can be found in the LICENSE file. | ||||
|  | ||||
| //go:generate go run generate.go | ||||
|  | ||||
| // Package stdlib provides a table of all exported symbols in the | ||||
| // standard library, along with the version at which they first | ||||
| // appeared. | ||||
| package stdlib | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| type Symbol struct { | ||||
| 	Name    string | ||||
| 	Kind    Kind | ||||
| 	Version Version // Go version that first included the symbol | ||||
| } | ||||
|  | ||||
| // A Kind indicates the kind of a symbol: | ||||
| // function, variable, constant, type, and so on. | ||||
| type Kind int8 | ||||
|  | ||||
| const ( | ||||
| 	Invalid Kind = iota // Example name: | ||||
| 	Type                // "Buffer" | ||||
| 	Func                // "Println" | ||||
| 	Var                 // "EOF" | ||||
| 	Const               // "Pi" | ||||
| 	Field               // "Point.X" | ||||
| 	Method              // "(*Buffer).Grow" | ||||
| ) | ||||
|  | ||||
| func (kind Kind) String() string { | ||||
| 	return [...]string{ | ||||
| 		Invalid: "invalid", | ||||
| 		Type:    "type", | ||||
| 		Func:    "func", | ||||
| 		Var:     "var", | ||||
| 		Const:   "const", | ||||
| 		Field:   "field", | ||||
| 		Method:  "method", | ||||
| 	}[kind] | ||||
| } | ||||
|  | ||||
| // A Version represents a version of Go of the form "go1.%d". | ||||
| type Version int8 | ||||
|  | ||||
| // String returns a version string of the form "go1.23", without allocating. | ||||
| func (v Version) String() string { return versions[v] } | ||||
|  | ||||
| var versions [30]string // (increase constant as needed) | ||||
|  | ||||
| func init() { | ||||
| 	for i := range versions { | ||||
| 		versions[i] = fmt.Sprintf("go1.%d", i) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // HasPackage reports whether the specified package path is part of | ||||
| // the standard library's public API. | ||||
| func HasPackage(path string) bool { | ||||
| 	_, ok := PackageSymbols[path] | ||||
| 	return ok | ||||
| } | ||||
|  | ||||
| // SplitField splits the field symbol name into type and field | ||||
| // components. It must be called only on Field symbols. | ||||
| // | ||||
| // Example: "File.Package" -> ("File", "Package") | ||||
| func (sym *Symbol) SplitField() (typename, name string) { | ||||
| 	if sym.Kind != Field { | ||||
| 		panic("not a field") | ||||
| 	} | ||||
| 	typename, name, _ = strings.Cut(sym.Name, ".") | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // SplitMethod splits the method symbol name into pointer, receiver, | ||||
| // and method components. It must be called only on Method symbols. | ||||
| // | ||||
| // Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow") | ||||
| func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) { | ||||
| 	if sym.Kind != Method { | ||||
| 		panic("not a method") | ||||
| 	} | ||||
| 	recv, name, _ = strings.Cut(sym.Name, ".") | ||||
| 	recv = recv[len("(") : len(recv)-len(")")] | ||||
| 	ptr = recv[0] == '*' | ||||
| 	if ptr { | ||||
| 		recv = recv[len("*"):] | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
							
								
								
									
										11
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @@ -71,19 +71,19 @@ github.com/otiai10/copy | ||||
| # github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e | ||||
| ## explicit | ||||
| github.com/serenize/snaker | ||||
| # golang.org/x/crypto v0.21.0 | ||||
| # golang.org/x/crypto v0.22.0 | ||||
| ## explicit; go 1.18 | ||||
| golang.org/x/crypto/pbkdf2 | ||||
| # golang.org/x/mod v0.16.0 | ||||
| # golang.org/x/mod v0.17.0 | ||||
| ## explicit; go 1.18 | ||||
| golang.org/x/mod/internal/lazyregexp | ||||
| golang.org/x/mod/module | ||||
| golang.org/x/mod/semver | ||||
| # golang.org/x/sync v0.6.0 | ||||
| # golang.org/x/sync v0.7.0 | ||||
| ## explicit; go 1.18 | ||||
| golang.org/x/sync/errgroup | ||||
| golang.org/x/sync/semaphore | ||||
| # golang.org/x/sys v0.18.0 | ||||
| # golang.org/x/sys v0.19.0 | ||||
| ## explicit; go 1.18 | ||||
| golang.org/x/sys/unix | ||||
| golang.org/x/sys/windows | ||||
| @@ -102,7 +102,7 @@ golang.org/x/text/transform | ||||
| golang.org/x/text/unicode/bidi | ||||
| golang.org/x/text/unicode/norm | ||||
| golang.org/x/text/width | ||||
| # golang.org/x/tools v0.19.0 | ||||
| # golang.org/x/tools v0.20.0 | ||||
| ## explicit; go 1.19 | ||||
| golang.org/x/tools/go/ast/astutil | ||||
| golang.org/x/tools/imports | ||||
| @@ -114,6 +114,7 @@ golang.org/x/tools/internal/event/tag | ||||
| golang.org/x/tools/internal/gocommand | ||||
| golang.org/x/tools/internal/gopathwalk | ||||
| golang.org/x/tools/internal/imports | ||||
| golang.org/x/tools/internal/stdlib | ||||
| # gorm.io/driver/postgres v1.5.7 | ||||
| ## explicit; go 1.18 | ||||
| gorm.io/driver/postgres | ||||
|   | ||||
		Reference in New Issue
	
	Block a user